I have been able to successfully create an issue using the REST api (rails gem) on my JIRA Service Desk instance (cloud). I have also been successful in setting the reporter, but I have noticed that although the customer has been set, the issue does not show up on the customer's request list. I readily figured out that the problem is that the request type was not being set.
The project that I am using has the issue type mapped to a specific request type. Furthermore, the Request Type field has been added to the create issue screen. In addition, I have manually set another issue to include the appropriate request type, and determined the request type field to be 'customfield_10047'.
With all this said, I have been very unsuccessful in setting the Request Type during creation. The first semi-sucessful attempt resulted in the following error:
customfield_10047: Operation value must be a string
This occurred when I was passing more complex information about the request type (so as to mirror an existing issue).
After this, the closest I managed to getting a semi-valid response is when the server was when using a pure string. In this case, the server responded with:
customfield_10047: Invalid customer request value
I've tried setting the string value to the id of the request type "97", and I've also tried setting it to the exact string value of the Request Type, namely "Purchase Request", but no matter what I enter, I get an error.
Any ideas on how this value can be set appropriately?
Hi @Peter Androutsos ,
It took a bit of research and testing but I am happy to say I managed to make this work in Jira Cloud as well. Also, I am adding this as a new answer so that if you like it you can accept it as the solution for this question.
The way to achieve what you are asking for is actually explained in below KB for Jira Server:
However, since in Cloud you do not have access to the Database, you cannot get the request type KEY from the AO_54307E_VIEWPORTFORM table as explained in above KB, but you will have to use the following REST API endpoint instead:
Calling to the above endpoint (or pasting it in the browser) with a correct issue ID and the correct service desk ID for the associated issue will result in JIRA returning a JSON response containing all customer request types within the service desk, including the Key.
Please notice that this is an internal endpoint not officially documented that can change without prior notice. Indeed we have the below Feature request opened in our system to have the official REST API endpoint to include the request-type key to which I have just added the workaround:
You may want to vote and watch the above feature request so that you will get notified in case of any update. The feature will be addressed according to the Implementation of New Features Policy.
Let me know if this helps.
Thanks for letting me know @Linwood Ma ! :)
Also, just FYI, I have summarized everything in the below KB article:
Hi @Peter Androutsos ,
In order to create a valid customer request in Jira Service Desk Cloud you may want to use the Jira Service Desk REST API endpoint /rest/servicedeskapi/request instead of the Jira Core Rest API endpoint /rest/api/2/issue (or /rest/api/3/issue).
For further details please see:
I hope this helps.
Have a nice weekend.
Thanks. I've since added some automation in the project which provides a workaround to this, but I will investigate trying to do this the other way around regardless. With that said, I am curious as to why the option to set the request type exists on the regular issue-generating api, but won't accept any value. Are there specifics to what values can be set for this parameter?
The actual problem is not that it does not accept any value, but that the value you are supposed to enter in there is not documented and not exposed by public APIs. For this I have added an howto/workaround yesterday.
However, can you kindly let us know the use case for which you need to call the Jira Core REST API endpoint to create the issue and you cannot use the Servicedesk ones, so that I can forward this feedback to the Jira Service Desk team?
Hi @Dario ,
I tried to follow your guide but i am still unable to get the Customer Request Type field's allowed value list.
I am working on Jira Cloud and i am trying to create a ticket using Google Scripting and trying to Populate the Customer Request Type field with an existing category 'Testing & Management' and my script returns "customfield_10800":"Invalid customer request value" error.
My project key is "Test" and i tried using the endpoint "rest/servicedesk/SERVICE_DESK/servicedesk/request/ISSUE/request-types" but it doesn't display anything on the screen.
Any help is highly appreciated.
The endpoint seem to have changed and now it is:
Also, the below KB has been updated in order to reflect the change:
Learn how to use two new reports for next-gen projects in Jira Cloud: Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events