Forums

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

How can I change an issuetype on an existing issue via the REST?

Nageswara Rao Koppisetti
Contributor
May 22, 2018

Hi All,

Could you please provide me issue type update rest web service and corresponding request payload for to update existing issutype.

1 answer

1 accepted

4 votes
Answer accepted
Alexey Matveev
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.
May 22, 2018
Nageswara Rao Koppisetti
Contributor
May 22, 2018

Hi Alexey Matveev,

Boris Georgiev saying  issue type probably can not be edited.Could you please tell me.Is possible or not.If possible post reference link .

 

Regards,

Nageswara.

Like Stephen Sifers likes this
Alexey Matveev
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.
May 22, 2018

Boris said, try to get info from editmetada resource and have a look, if it is possible.

Nageswara Rao Koppisetti
Contributor
May 22, 2018

Hi Alexey

I have requested below rest api and  below payload:

rest/api/2/issue/10206/editmeta

My Requested payload is:

{
"update":
{"issuetype": [{
"set": "Bug"
}
]
}
}

 

restserviceErrorissutype.png

 

getting 405 method error please find my attached screen .If in case if i am wrong please help me on this.

Alexey Matveev
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.
May 22, 2018

Here is it. First I executed GET rest/api/2/issue/issuekey/editmeta. The result was like this:

"issuetype": {
"required": true,
"schema": {
"type": "issuetype",
"system": "issuetype"
},
"name": "Issue Type",
"operations": [],
"allowedValues": [
{
"self": "http://localhost:8080/jira/rest/api/2/issuetype/10100",
"id": "10100",
"description": "A task that needs to be done.",
"iconUrl": "http://localhost:8080/jira/secure/viewavatar?size=xsmall&avatarId=10318&avatarType=issuetype",
"name": "Task",
"subtask": false,
"avatarId": 10318
},
{
"self": "http://localhost:8080/jira/rest/api/2/issuetype/10001",
"id": "10001",
"description": "Created by JIRA Software - do not edit or delete. Issue type for a user story.",
"iconUrl": "http://localhost:8080/jira/images/icons/issuetypes/story.svg",
"name": "Story",
"subtask": false
}
]
}

Look at the allowedValues. It means that issuetype can be set either to Story or to Task. Then I executed PUT  /rest/api/2/issue/issuekey with the following JSON:

{"fields":{"issuetype":{"id":"10001"}}}

The issue type field was changed to Story.

Like # people like this
Nageswara Rao Koppisetti
Contributor
May 22, 2018

Hi Alexey..

 

Thank you for your supporting .working as expected as for your information.

Thank you very much.

amitava
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!
April 3, 2020

This is not working for me!

amitava
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!
April 3, 2020

Is there any problem with my code? -

 

headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}

payload = json.dumps({"fields": {"issuetype":{"id":"10328"}}})

response = requests.request(
"PUT",
url,
headers=headers,
auth=auth,
data=payload
)

Suggest an answer

Log in or Sign up to answer