Forums

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

How to set Request Type when editing or transition an issue via REST API

Александр
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 27, 2021

Hello!


I am trying to edit request type via JIRA REST API and I get a 500 Internal Server Error.


But if I try to create an issue, everything will be ok and the issue will appear with the required request type.

in my case, it is "customfield_17801" 

Сustom Field Option:

"customfield_17801": {
"required": false,
"schema": {
"type": "sd-customerrequesttype",
"custom": "com.atlassian.servicedesk:vp-origin",
"customId": 17801
},
"name": "Тип запроса клиента",
"fieldId": "customfield_17801",
"operations": [
"set"
]
}

To create an issue, the following code works for me:
POST https://mydomain.com/rest/api/2/issue

{
"fields": {
"summary": "test",
"description": "test",
"project": {
"key": "HD"
},
"reporter": {
"name": "Reropter@domain.com"
},
"customfield_17801": "hd/64d1aba4-bb35-49c2-80a8-c98fa9744804"
}
}

 

But as soon as this is not created an issue, but something else
let's say editing or transition, Jira returns me a 500 error

 

edit example:

PUT https://mydomain.com/rest/api/2/issue/HD-123456

{    
"fields":  {
"customfield_17801":"hd/64d1aba4-bb35-49c2-80a8-c98fa9744804"
}
}

 

and a transition example:

POST https://mydomain.com/rest/api/2/issue/HD-123456/transitions?expand=transitions.fields

{    

"fields":  {        

"customfield_17801": "hd/64d1aba4-bb35-49c2-80a8-c98fa9744804"

},    

"transition":  {
"id":  "761"
}

}

 

If I remove customfield_17801 from the request and try to edit any other field, the request will be successful.

I spent a lot of time looking for a solution, but I never found it. The only thing I could find was this task with a similar problem.
https://ecosystem.atlassian.net/browse/JSDECO-36

I am beginning to suspect that this field cannot be edited with API.

 

Please any help

1 answer

0 votes
Markus
Contributor
August 6, 2021

From using Jira for automation, when you try to edit the Request Type it has a notification that there is no API for editing the request type.

adham mhaydat
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 23, 2024

Hi @Markus 
How can i fill the Customer Request Type field by using the create issue API

Suggest an answer

Log in or Sign up to answer