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
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.
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"}]}]}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.