How to set the Request Type when creating an issue using Jira REST API in Atlassian Cloud

Still need help?

The Atlassian Community is here for you.

Ask the community

This article requires fixes

This article has been Flagged for fixing. Use caution when using it and fix it if you have Publisher rights.


Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Purpose

This article explains the JSON data required to set the customer request type when creating a Jira Service Management request using the Jira Work Management (/rest/api/2/issue or /rest/api/3/issue) endpoint in Cloud.

However, please notice that:

Solution

  • To set the request type via REST API, you will have to userest/servicedesk/1/servicedesk/request/ISSUE_ID/request-types the custom field ID for the Request Type custom field. For example, if the request type custom field in your instance has the id of 10202, you will have to use customfield_10202.

  • As for the value, it is actually a combination of the project key and the value of the Key property for the desired request type (project-key/Key) that can be retrieved by calling the internal endpoint: 
    https://YOUR_HOSTNAME/rest/servicedesk/1/servicedesk/request/ISSUE_ID/request-types
      • An example of a valid value is sda/getithelp   

  • Calling to the above endpoint (or pasting it in the browser) with the correct issue ID and service Management ID of an already existing issue in the same service Management project you want to create the new issue will result in Jira returning a JSON response containing all the customer request types within the service Management, including the Key property. 

    Please notice that this is an internal endpoint not officially documented that can change without prior notice. We have the below Feature request opened in our system to have the official REST API endpoint to include the request-type key:

  • Make sure that the Customer Request Type is added to the create issue screen. 

  • Here is a sample JSON data which works

    {
        "fields": {
            "project": {
                "id": "10205"
            },
            "summary": "Something's wrong",
            "issuetype": {
                "id": "10100"
            },
            "priority": {
                "id": "1"
            },
            "components": [
                {
                    "id": "10000"
                }
            ],
            "customfield_10202": "sda/getithelp"
        }
    }
  • You'll just have to identify the custom field id and valid values and you should use for it to work.



DescriptionSet Request Type when creating an issue via Jira REST API in Cloud
ProductJira Cloud, Jira Service Management, Jira Work Management

Last modified on Apr 26, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.