Forums

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

Automation: Update version name on release

Alex Cadevall December 29, 2023

Hello,

I am trying to create an automation to release a fixVersion when all issues are done and then change its name when released. However, I am unable to do so.

I am using a PUT API call to change the version's name field upon release but the following error keeps appearing:

Error publishing web request. Response HTTP status: 400

The URL I am using: https://MyCompanyName.atlassian.net/jira/rest/api/3/projects/ProjectName/versions/{{issue.fixVersions.id}}

Notes:
- I am trying to keep the {{id}} dynamic to make this automation as scalable as possible
- The trigger happens when an issue is moved to DONE status
- My company uses several projects, this automation is for a particular one

You can check current flow here:
Captura.JPG

Any help would be very much appreciated, thanks!

2 answers

1 accepted

1 vote
Answer accepted
Fernando Eugênio da Silva
Community Champion
December 29, 2023

@Alex Cadevall , Welcome to the Atlassian Community!

 

According JIRA API REST documentation your URL is wrong. Please, try to use this URL: https://your-site.atlassian.net/rest/api/3/version/{{issue.fixVersions.id}}

I did some tests and works fine. Consider this documentation to Fix Versions API in Jira Cloud: Update Version - REST API

If you want change only the name use this custom payload:

 

{
"name": "NEW RELEASE NAME"
}

Hope this helps you. 

Alex Cadevall January 9, 2024

Hello, thanks for your response!

It seems that, even with the URL changes, the result is the same sadly

Captura1.JPG

Captura.JPG

Fernando Eugênio da Silva
Community Champion
January 9, 2024

@Alex Cadevall 

Have you checked your token or your permissions in the project where this version is presented.

Ensure that you are in administrators project role or consider try another Jira API TOKEN. I'm leaving an attachment of my rule that is working so you can just take a new look and see if is similar to this one. Then you can try to change your API token to see if your the current problem is associated with your token or permissions.

Screenshot_167.png

Hope this helps

Alex Cadevall January 10, 2024

It was indeed the token, thanks a lot for your help!

0 votes
Bill Sheboy
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.
January 9, 2024

Hi @Alex Cadevall -- Welcome to the Atlassian Community!

Just to confirm: for the issue triggering this rule, how many versions are assigned to Fix Versions?

As written, the rule would only support one value in the Fix Versions field.  Having multiple values would cause an invalid URL for that request.

Kind regards,
Bill

Alex Cadevall January 10, 2024

Yes, it was both a URL problem and token problem.

For the URL I had to simplify it to the one indicated by @Fernando Eugênio da Silva URL: https://your-site.atlassian.net/rest/api/3/version/{{issue.fixVersions.id}}

Regarding the Token I had not added Basic in front of the base64 coded email+token.

Thanks a lot for your help!

Like # people like this

Suggest an answer

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

Atlassian Community Events