Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to set request type value in while create jira issue

Sai Kiran Konkumatti June 13, 2019

By following link

https://confluence.atlassian.com/jirakb/how-to-set-request-type-when-creating-an-issue-via-rest-api-using-rest-api-2-issue-endpoint-938041214.html

ProjectKey: IT

Request type Name: offers/sales

while setting request type values as "IT/offers/sales"

while creating issue getting resposnse as

{"errorMessages":[],"errors":{"customfield_10900":"Invalid customer request value"}}

request name with out slash working how we need to handle slash in working

2 answers

1 accepted

0 votes
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 2, 2019

Hi @Sai Kiran Konkumatti , @Payne ,

In below thread I have provided a workaround to get the request-type Key using an internal REST API endpoint and therefore without having to access the DB:

 

Also, you may want to watch and vote for the below Feature Request asking to the requesttype REST API endpoint for JSD to return the Keys:

 

 

Cheers,
Dario

Sai Kiran Konkumatti July 3, 2019

cloud support team has given AO_54307E_VIEWPORTFORM  table content with that issue resolved

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 3, 2019

@Sai Kiran Konkumatti I know but in case you will add any other request type now you can get the Key without having to open a support ticket :) 

Also, can you kindly share the use case for which you cannot use the Jira Service Desk REST API to create the ticket but you have to use the Jira Core REST APIs instead?

 

Thanks,
Dario

Sai Kiran Konkumatti July 3, 2019

by using url (https://YOUR_HOSTNAME/rest/servicedeskapi/servicedesk/servicedesk_id/requesttype) with rest api key value not getting we are able to get only id

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 3, 2019

@Sai Kiran Konkumatti ,

What I am asking is, why do you want to create a Service Desk request using:

  •  https://YOUR_HOSTNAME/rest/api/2/issue (or /rest/api/3/issue)

instead of using: 

  • https://YOUR_HOSTNAME//rest/servicedeskapi/request 

is there any particular reason/use-case we should be aware of?

 

Thanks,
Dario

0 votes
Payne
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2019

If you have ScriptRunner installed, or some other way to run Groovy scripts, you can try running the following, setting the issue key to that of an issue with the desired request type.

import com.atlassian.jira.component.ComponentAccessor
def issue = ComponentAccessor.issueManager.getIssueByCurrentKey("TIS-709") //Issue with the desired Request Type
def cf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Customer Request Type")
issue.getCustomFieldValue(cf)

That will return a GUID that represents that request type, e.g.

IT/54b0654e-24b6-477d-a44e-56edcc0ca962

Then you can try using that value when setting your request type.

Sai Kiran Konkumatti June 13, 2019

https://{domain}/rest/api/2/issue/IS-48

while trying with above rest api url  that i am able to get response as

"requestType": {
"_expands": [
"field"
],
"id": "176",
name": "offers/sales",
"description": "offers/sales",
},

while setting id as 176 or offers/sales it saying custom_10900 as invalid value

Payne
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2019

Right; you don't need the ID; you need the GUID.

Sai Kiran Konkumatti June 16, 2019

but from above rest api we are not getting GUID value

Payne
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 17, 2019

Right; in my original reply I describe using a scripting tool like ScriptRunner if you have it to get the GUID. I don't know of a way otherwise, except for possibly querying the database directly if you have the means.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events