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:
- I'm only specifying the id and name fields on the requestType so maybe I need all of the link and other fields?
- Can anyone give me a sample JSON with a working request-type?
- Do I need to use a different create URL which has the 111 in it?
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