Forums

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

Version name is not valid when updating issue fixVersions via API

victor October 20, 2020

I'm getting a Version name is not valid error when trying to set the fixVersions of an issue:

curl --request PUT \
--url 'https://[subdomain].atlassian.net/rest/api/3/issue/[issue]' \
--header "Authorization: Basic XXX" \
--header 'Content-Type: application/json' \
--data '{"update": {"fixVersions":[{"set": [{"name": "v10.26.0"}]}]}}'

I get the following error:


{"errorMessages":[],"errors":{"fixVersions":"Version name 'v10.26.0' is not valid"}}

 

However the version does exist, I can get it from the versions endpoint, when I do:

 

curl \
--header "Authorization: Basic XXX" \
'https://[subdomain].atlassian.net/rest/api/3/project/[project]/versions'

I get:

 

{"self":"https://[subdomain].atlassian.net/rest/api/3/version/[version]","id":"[version]","name":"v10.26.0","archived":false,"released":true,"releaseDate":"2020-10-20","userReleaseDate":"20/Oct/20","projectId":[project]}

 

Any ideas what I could be doing wrong? Thanks 

2 answers

1 vote
victor October 20, 2020

SOLVED: See my comment above, if you're getting this error make sure that the issue belongs to the same project as the version.

I know this sounds obvious but there might be complex setups where this is not as clear.

0 votes
Niranjan
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.
October 20, 2020

Hi @victor ,

It seems the issue is related to this KB - https://confluence.atlassian.com/jirakb/could-not-find-valid-id-or-name-in-object-when-using-the-add-operation-for-rest-api-722144587.html

You may need to try with ADD instead of SET. 

Also try this one 

{"update":{"fixVersions":[{"set":[{"name":"v10.26.0"}]}]}}

victor October 20, 2020

Hi Niranjan, it turns out the syntax was correct the problem was that I hadn't realised that the versions need to be created under the project the issue belongs to.

We have an umbrella project that shows tickets belonging to different projects, we normally create a manual release from there and that works.

When we tried to automate the process we were just creating a version under the umbrella project but then when assigning the version to an issue that belongs to a different project we would get the error:

Version name is not valid

So now we iterate over the different issues and create the new version under all the right projects.

I hope this is helpful if somebody is in the same situation as I was. Thanks!

Like Derek Owens likes this

Suggest an answer

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

Atlassian Community Events