It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira api, add new fix version does not work

Viktor Rodionov Nov 24, 2017

Hi all,

I try to add a fix version(new version which is not exist yet) to jira issue.

$json = '{ "update" : {"fixVersions" : [ {"add" : {"name" : "TEST-123"}}] } }'

Invoke-RestMethod -Uri https://jira.xxx.lan/rest/api/2/issue/ISSUE-911 -Method PUT -Headers $headers -ContentType "application/json" -Body $json

It works if the version "TEST-123" is already exist. But if it is not, I am getting 400 error (bad request).

Could you help, please?

1 answer

0 votes
Alexey Matveev [cPrime] Community Leader Nov 24, 2017

Hello, 

Check first if the version exists with GET /rest/api/2/project/{projectIdOrKey}/versions

If not, then create it with POST /rest/api/2/version

Then use your Rest call

Viktor Rodionov Nov 24, 2017

Thank you very much, Alexey! I will try. 

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira

Try Jira Cloud for Outlook: Organize your work without leaving your inbox

Hi Atlassian community, My name is Max and I work on the product integration team at Atlassian. I am pleased to announce the early access program for the Jira Cloud add-in for Outlook. This add-in...

2,381 views 6 15
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you