I've read this question/answer but I'm still struggling with setting the request type on a new issue using the REST api. When my users go to the portal, they choose a request type which takes them to the URL path like /servicedesk/customer/portal/8/create/111, where 8 is the portal number and 111 is the request-type. This works fine.
I'm trying to drive this process using the REST API. I'm creating issues via POST to
/rest/api/2/issue/ but when I try to set the request-type field, I get something like:
{"customfield_11200":"Field 'customfield_11200' cannot be set. It is not on the appropriate screen, or unknown."}
If I look at tickets that were created using the UI, I see that the request type seems to be customfield_11200 and that it has a form like:
{ "_links": { ... }, "requestType": { "id": "111", "name": "C++ Request", ... }
I've tried setting this customfield as well as the "requestType" field with requestType as a subfield but I get the above error.
Questions:
Oh and I've not been able to find the request-type key via the API trying the following request which doesn't seem to work with my Jira instance:
/servicedesk/1/servicedesk/request/#####/request-types
Thanks for any help.
gray
I just figured this out. I was inappropriately using the "/rest/api/2/issue/"
call when I should have been using the "/rest/servicedeskapi/request" which takes a JSON payload with 'serviceDeskId' and 'requestTypeId' fields.
Driving it through the service-desk API means that the workflow is used so the field validations and various automations are performed so I should have been doing it this way from the start although some of the workflow rules were firing using the issue API.
I also figured out the right way to lookup the request-ids:
/
rest/servicedeskapi/servicedesk/#/requesttype
There may be some way to create service-desk tickets through the issue API with a correct request-id but I couldn't figure it out so I'm glad that this seems to be working.
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.