Integrating Custom Form Fields into Jira Ticket Creation API
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
Atlassian now allows adding form fields in ticket creation via the REST API, using the experimental "form" parameter.
Experimental feature
The form parameter used in this article is marked Experimental. Its contract may change without notice. If you depend on this parameter in production, monitor the Jira Service Management Cloud changelog for breaking changes.
Solution
The JSON structure for ticket creation
Based on the REST API documentation, use the JSON structure below to fill form fields when creating a ticket. This guide clarifies the field types for each JSON element and shows how to use them effectively.
JSON to fill form fields
...
"form": {
"answers": {
"1": {
"text": "Answer to a text form field"
},
"2": {
"date": "2023-07-06"
},
"3": {
"time": "14:35"
},
"4": {
"choices": [
"5"
]
},
"5": {
"users": [
"qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d69abfa3980ce712caae"
]
}
}
},
...Understanding the JSON for each field type
First, understand that the JSON element "1" represents form field IDs. To find out which form field corresponds to each ID, use The Forms REST API request.
The table below shows how to use the JSON structure to add values to form fields. Remember to update the field ID to match the ID in your form.
Field type | Valid JSON | Additional information |
|---|---|---|
Short/Long text |
| |
Date |
| |
Date time |
| |
| ||
Radio button |
| Get the choice IDs from the API Get form on a request type |
Checkbox |
| Get the choice IDs from the API Get form on a request type |
Dropdown |
| Get the choice IDs from the API Get form on a request type |
User |
| |
Assets object |
| Get the Assets object IDs from the API Get object {id}. The ID used in this field is the "globalId" |
Confirm that the form answers are attached
After you send the request:
Open the created request in Jira Service Management.
Scroll to the Form section on the issue view and verify that each submitted answer appears under its corresponding form field.
Confirm that any Jira fields you omitted from
requestFieldValues(because the form supplies them) are not duplicated on the issue — the form answers should be the single source for those values.
If the form section is missing or answers are blank, check that:
The
formobject's field IDs match the IDs returned by The Jira Service Management Cloud REST API.The request type has a form attached to your project's request-type settings.
Was this helpful?