Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,367,189
Community Members
 
Community Events
168
Community Groups

How to set select lists (single, multiple, cascading), radio or checkboxes on create issue with REST

This small how-to is all about setting custom fields on creating an issue. Apart from the customfield_xxxxx elements, only the minimum required fields are set.

The REST API endpoint

POST https://myjiradomain.com/rest/api/2/issue

HTTP Headers to be set

  • Content-Type: application/json
  • User-Agent: x (required only, if you get an XSRF from browser)
  • Origin: https://myjiradomain.com (required only, if you get an XSRF)

JSON request body for Select List (single choice) / Radio Buttons

{
"fields": {
  "project": {
"key": "REST"
},
  "summary": "Issue created from REST API",
  "issuetype": {
"id": "1"
},
  "customfield_10100": {
"value": "First"
}
  }
}

JSON request body for Select List (multiple choices) / Checkboxes

{
"fields": {
"project": {
"key": "REST"
},
"summary": "Issue created from REST API",
"issuetype": {
"id": "1"
},
"customfield_10200": [
{
"value": "Apple"
},
{
"value": "Banana"
}
]
}
}

JSON request body for Select List (cascading)

{
"fields": {
  "project": {
"key": "REST"
},
  "summary": "Issue created from REST API",
  "issuetype": {
"id": "1"
},
  "customfield_10300": {
"value": "Mammal",
"child": {
"value": "Elephant"
}
}
  }
}

JSON request body for Select List (cascading) with 'none' on child option

{
"fields": {
  "project": {
"key": "REST"
},
  "summary": "Issue created from REST API",
  "issuetype": {
"id": "1"
},
  "customfield_10300": {
"value": "Mammal",
"child": null
}
  }
}

Tested with Jira Software Server 8.13.3.

1 comment

This article is good. Thanks @Thomas Deiler 

Srikanth Ganipisetty

Like Thomas Deiler likes this

Comment

Log in or Sign up to comment
TAGS

Atlassian Community Events