Forums

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

How to change the Jira issue status REST API?

kumar August 13, 2024

Hi all,

 

As a title say, I am trying to change the jira status using REST API.

 

I have written a small script. Unfortunately, it is not working as expected.

 

Can anyone look into script and let me know if I am missing something?

 

 

 

url = "https://domain-name.atlassian.net/rest/api/2/issue/{id}/transitions?expand=transitions.fields"

headers = {

  "Accept": "application/json"

}

json_data = {

        "update": {

        "comment": [

            {

                "add": {

                    "body": "Issue is rejected."

                }

            }

        ]

    },

   "transition": {

     "id": "161"

   }

  }

for issue_id in issue_ids:

    response = requests.request(

   "POST",

   url.format(id=issue_id),

   data=json.dumps(json_data),

   headers=headers,

   auth=auth

   )
Thanks in advance

1 answer

0 votes
Trudy Claspill
Community Champion
August 13, 2024

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events