I'm creating issue via API call in Jira Service Management which works fine.
Now I want to add the organization on moment of creation, but can not get this working. I figured out that customfield_10500 is holding the organization, but trying to set in via the API call keeps ending in the following error:
{"errorMessages":[],"errors":{"customfield_10500":"The Organization ID must be a number"}}
My (sanitized) API-call:
curl --request POST \
--url 'https://xxxxxxx.atlassian.net/rest/api/3/issue' \
-H "Authorization: Basic xxxxxxx" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"fields": {
"summary": "This is createdvia an API call",
"issuetype": {
"id": "10285"
},
"project": {
"key": "xxx"
},
"customfield_10500": [
{
"ID": 4
}
],
}
}'
I tried to put the organization id between quotes, square brackets and using the name. But no luck until now.
Once the issue is created I can set the organization manual, but that is a manual intervention I want to avoid :-)
You need to set the id in an array as a number. The organization field is capable of containing other organization values, so as an array it just needs the value of the organization id. e.g
--data '{
"fields": {
"summary": "This is createdvia an API call",
"issuetype": {
"id": "10285"
},
"project": {
"key": "xxx"
},
"customfield_10500": [4]
}
}'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.