Here is the JSON I am using:
{ "serviceDeskId":"7",
"requestTypeId":"127",
"requestFieldValues":{ "customfield_15846":{ "value":"CDN Services",
"child":{ "value":"New Configuration"
}
},
"customfield_15607":{ "value":"High"
},
"customfield_15910":"172.30.136.46",
"customfield_15909":"",
"customfield_15894":1,
"customfield_15895":997,
"customfield_15896":"Sysadmin",
"customfield_15869":"BOT",
"customfield_15795":[ { "name":"5badbe291fa6b77b16764f29"
}
],
"summary":"Ticket with attachment",
"description":"Ticket with attachment"
},
"raiseOnBehalfOf":"5cb5692f1e9af40e540c0f55"
}
The approver is not set even when I am sending it - customfield_15795
Can you let me know if I am doing something wrong?
Hello Ankit,
Thank you for reaching out to Community!
I tested the same REST API I posted on this other thread just to make sure it was still valid and it worked.
I see that you are not using the same order, so I'm not sure if it will work.
Can you please use the same template I posted and just change the IDs?
I see that you have other custom fields, but use that simple one just to check if the approver will be added.
curl --request POST \
--url 'https://xxxxxxx.atlassian.net/rest/servicedeskapi/request' \
--user 'email@domain.com:APITOKEN' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"serviceDeskId": "12",
"requestTypeId": "223",
"requestFieldValues": {
"summary": "Request JSD help via REST",
"description": "I need a new *mouse* for my Mac",
"customfield_10100": [{ "name":"1a23b45cde67f89g1h23ij4k" }]
}
}
}'
Regards,
Angélica
@Angélica LuzMy guess is that you are not a programmer? In a JSON, the sequence of key-value pairs (the ones inside the curly brackets {}) doesn't matter. In fact, it doesn't matter in any programming language.
If you use a programming language to call this API, the JSON that is created will have the key-value pairs in any order. Only in an array (the ones with square brackets) can you control the ordering.
Anyhow, just in case I might be missing something, I did try what you said and used this:
curl --request POST \
--url 'https://mycompany.jira.com/rest/servicedeskapi/request' \
--user 'email_id:token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"serviceDeskId": "7",
"requestTypeId": "127",
"requestFieldValues": {
"summary": "Request JSD help via REST",
"description": "I need a new *mouse* for my Mac",
"customfield_15795": [{ "name":"5badbe291fa6b77b16764f29" }]
}
}
}'
Still, the approvers were not added. Can it be due to something in the workflow? Any suggestions where I can investigate are welcome
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Get started with Jira Service Management
These short, self-paced courses will help you get up and running in Jira Service Management in just 90 minutes.
Learning Path
Adopt ITSM practices with Jira Service Management
Use this path to build your IT Service Management knowledge and earn an Atlassian certification.
Setting Up ITSM Projects in Jira Service Management
This training series helps you get started in Jira Service Management quickly with the new ITSM project template.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.