Dear Atlassian community,
I would like to ask you if there is a way to set the CRT of an issue when creating it via REST API on the Cloud platform. I read some articles but none of them were helpful. From my testing, all I get is:
I tried with ID, I tried with name but I get the same result. The field is included in the create issue screen. I would be very happy if you could give me some advice :)
Best regards,
Nadezhda Hristova
Hey @Nadezhda Hristova ,
Seems that it's not as easy as just any regular field :)
The process is described here https://confluence.atlassian.com/jirakb/how-to-set-the-request-type-when-creating-an-issue-using-jira-rest-api-in-atlassian-cloud-974366000.html
Hey Dirk,
Thank you very much for the fast response. Everything looks nicely explained but I just have trouble with this API call:
rest/servicedesk/1/servicedesk/request/ISSUE_ID/request-types
I put it as it is but I also tried with the service desk portal id, issue key and so on. I did not have success - I get the 404 error.
Is it possible to explain it in a bit more detailed manner? I would be very thankful :)
Best regards,
Nadezhda Hristova
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Nadezhda Hristova ,
to use that endpoint you need to use the issueID and not the issue key.
In the related Cloud issue (https://jira.atlassian.com/browse/JSDCLOUD-4917) it is actually mentioned by one of the comments.
Note that's it'sissue id(eg. 123456) and notissue key(eg. SDA-123) - might be why you're getting 404.
When requesting that endpoint, the value of the customfield is the combination ofportalKeyandkeyfor the customer request type that you want:portalKey/key. So in the example given in the workaround articles, the response tohttps://YOUR_HOSTNAME/rest/servicedesk/1/servicedesk/request/ISSUE_ID/request-typeswould have been something like:{ { "validRequestTypes": [ { "id": 123, "cvId": 12, "portalKey": "sda", "portalId": 10, "key": "getithelp", [...] }, [...] ]}And therefore the value would besda/getithelp
You can find an issue id by requesting /rest/api/3/issue/<issue-key>.
So you'll first have to call the /rest/api/3/issue/<issue-key> endpoint to get the issue key and then use the issueid to go on to the next step
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got it the right way this time. Thank you, Dirk!
And since I am here on the topic of REST API, could you tell me if there is a way to get the id of this button and its options in the portal:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure that might be possible.
What would your use-case be for these?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A team of ours is making integration with another platform and they were thinking of adding those, if possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you'd need to look more at what functionality they want and work from there.
The dropdown that you see are actually just filters for the tickets so in the background they would just be using a JQL meaning those filters could be re-created using your own filtering.
A good start might be the JQL documentation for the REST API
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.