How to create an issue using REST API with a specific customer request type?

Oliver December 19, 2020

Hi,

i want to create a ticket having a specific CRT. I managed to create the ticket (issue) without it but still don't get how works with an CRT?

I tried to add the custom field used for it from an existing ticket ("customfield_10001") but still no luck, whatever i put there as value(s).

Maybe i totally misunderstand the concepts here to follow... after all, i'm not a Jira administrator but an programmer having a API user given to work with.

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2020

Before we try to answer what might be the wrong question, could you clarify what "CRT" is?

In Jira-speak, a customer request type or request type is not a custom field.  Could you confirm that you really do have a field that is called "customer request type" and if so, what type of field it is (text, (multi-)select, radio, etc)

Oliver December 19, 2020

Thanks for asking Nic, i try to answer as good as i can...

CRT was my short for "Customer Request Type". We have this field which populates with different selections, depending on the issuetype (here it was set to "Service request" and tho these multiselection values appear):

19-12-2020 14-34-45.jpg

When i load this issue from Jira (Service Desk) using the API i find this as "customfield_10001":

"customfield_10001": {
"_links": {
"jiraRest": "https://servicedesk.internal.com/rest/api/2/issue/29291",
"web": "https://servicedesk.internal.com/servicedesk/customer/portal/5/SUPP-665",
"self": "https://servicedesk.internal.com/rest/servicedeskapi/request/29291"
},
"requestType": {
"id": "88",
"_links": {
"self": "https://servicedesk.internal.com/rest/servicedeskapi/servicedesk/5/requesttype/88"
},
"name": "Zugriff beantragen",
"description": "",
"helpText": "",
"serviceDeskId": "5",
"groupIds": [
"23"
],
"icon": {
"id": "10626",
"_links": {
"iconUrls": {
"48x48": "https://servicedesk.internal.com/secure/viewavatar?avatarType=SD_REQTYPE&size=large&avatarId=10626",
"24x24": "https://servicedesk.internal.com/secure/viewavatar?avatarType=SD_REQTYPE&size=small&avatarId=10626",
"16x16": "https://servicedesk.internal.com/secure/viewavatar?avatarType=SD_REQTYPE&size=xsmall&avatarId=10626",
"32x32": "https://servicedesk.internal.com/secure/viewavatar?avatarType=SD_REQTYPE&size=medium&avatarId=10626"
}
}
}
},
"currentStatus": {
"status": "Fertig",
"statusDate": {
"iso8601": "2020-12-17T09:06:57+0100",
"jira": "2020-12-17T09:06:57.000+0100",
"friendly": "Vor 2 Tagen 09:06",
"epochMillis": 1608192417000
}
}
},

I hope this is what you wanted to know?!

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2020

Yes, sort of.  

That is the Service Desk request type, it's represented as a custom field in the REST API output because that's how Service Desk gets a handle on it and links it to an issue,

But you can see it's quite a complex "field" from that data, and you can't just set or edit it directly.

Requests are different entities to issues, although they all have a single unique issue behind them.

For working with requests, you'll want to use the REST API over at https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-post  - expand the section in the left-hand panel called "Request"

Oliver December 19, 2020

Aaah, you enlightened me! I thought requests and issues are the same, but you are right, they don't. I read and try to understand what you pointed me to and come back on further questions.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2020

You're not far off thinking they're the same thing.  There is a 1:1 relationship between each one, and a request cannot exist without an issue.

I usually describe a request as a layer on top of an issue, or something that wraps around one, rather than a completely separate object.

Jira is an issue tracker, so it has an object to track - the issue.  That has fields, workflow, history, comments, etc.  Jira users work with these. 

 Jira Service Desk/Management adds Requests, which add functions and data on top of an issue, mostly the layer of stuff the customer gets to see.  The issue it is wrapped around still does the fields, workflow and so-on.  The request even has the same key - it's using the issue it is wrapped around to provide that!

So, you can create issues without any request stuff on them, but you can't create requests without an issue to support them!

Suggest an answer

Log in or Sign up to answer