So I am currently creating tickets through the API using the Issues post endpoint. I have everything set right and the ticket is created as a service request. But I want to select a certain service request type, like "General Service Request", but i can't seem to figure out how I can do that using the API. Does anyone know how this is done? I keep seem that it's a customfield, but if it is, it doesn't appear the same when inspected.
Hello,
Every request type has its own ID which you can see it in the URL while you are editing the request type.
In you JSON body, you can mention the json value as
Below article explains the JSON data required to set the customer request type when creating a Jira Service Management request using the Jira (/rest/api/2/issue or /rest/api/3/issue) endpoint in Cloud.
How to set the Request Type when creating an issue using Jira REST API in Atlassian Cloud
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Brady Buttrey ,
Use the value customfield_XXXXX
and REQUEST_TYPE_ID
to correctly set the request type in your API call for creating Jira tickets.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To define a request type (such as "General Service Request") when creating a ticket via Jira's API, you need to ensure that you are setting the correct request type in the API request. This is typically done using the requestTypeId
field, but it's not as straightforward as using a custom field in the issue creation payload. Here's how to proceed:
Find the Request Type ID: You need the requestTypeId
corresponding to the "General Service Request" type. This ID can be retrieved via the Jira Service Desk REST API.
GET /rest/servicedeskapi/servicedesk/{serviceDeskId}/requesttype
Use the Correct API Endpoint: When creating a Jira Service Management (formerly Jira Service Desk) ticket, you need to use the Jira Service Management API, not just the Jira Core issue creation API. The endpoint to use is:
POST /rest/servicedeskapi/request
Payload Structure: In the payload, you need to specify both the requestTypeId
and the serviceDeskId
(the ID of the service desk the request type belongs to).
Here's an example payload to create a request of type "General Service Request":
{
"serviceDeskId": "1", // The ID of your service desk
"requestTypeId": "37", // The ID of the request type (e.g., General Service Request)
"raiseOnBehalfOf": "customer@example.com", // Optional: the email of the customer
"requestFieldValues": {
"summary": "This is a general service request",
"description": "Detailed description of the issue"
}
}
serviceDeskId
: The ID of the service desk where the request is being raised.requestTypeId
: The ID of the request type, which you retrieved from the API in step 1.raiseOnBehalfOf
: (Optional) You can raise the request on behalf of another customer if needed.requestFieldValues
: This contains the fields of the issue (summary, description, etc.).To get the requestTypeId
for "General Service Request", use the following API request:
curl -u your-email:your-api-token \
-X GET \
-H "Content-Type: application/json" \
https://your-domain.atlassian.net/rest/servicedeskapi/servicedesk/{serviceDeskId}/requesttype
This will return a list of all request types and their IDs. Find the one named "General Service Request" and note its id
.
/rest/api/3/issue
) does not support setting the request type directly. It only creates generic issues, so you need to use the Service Management API.Let me know if you need further clarification or help with this!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.