Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,741
Community Members
 
Community Events
184
Community Groups

How to use the Rest API from PowerShell to change the issue status?

Steve Campbell
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!
May 03, 2023

I've been working with this for a while now. I know that this needs to be done as POST request. From what I've read, it looks like the JSON data should be this:

{"transition":{"id":"11"}}

My problem (I think) is that I can't seem to get it formatted correctly for the POST. I originally tried using curl (from Windows) but had no luck and switched to Powershell and Invoke-RestMethod. Here's the line as I currently have it:

Invoke-RestMethod -Uri "<Jira-BaseURL>/rest/api/latest/issue/<Issue-Key>/transitions" -Headers @{Authorization = "Bearer $JiraPAT"} -Method Post -Body $body -ContentType "application/json"

Can anyone tell me how to declare the variable $body to work with this? 

I've had successful GET requests so I know my authentication is working.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events