I'm using a service account with the scopes:
read:jira-work
write:jira-work
manage:jira-project
When I do the API call, it gives the following the error:
{
"errorMessages": [
"Project with key 'null' either does not exist or you do not have permission to create versions in it."
],
"errors": {}
}
Endpoint I'm using: POST https://api.atlassian.com/ex/jira/<redacted>/rest/api/3/version
I followed the following docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/#api-rest-api-3-version-post
Body:
{
"projectId": 0,
"name": "test"
}
Hello @b_nijhuis
It sounds like you've run into the classic "scopes vs. permissions" trap. Even with the right scopes enabled, Jira still treats your service account like a user, which means it needs the Administer Projects permission within the project itself to create versions. Scopes just give the account permission to ask, but the Jira permission scheme decides if it's allowed to act.
A good way to verify this is to see if the account can actually "see" the project first. Try running a simple GET on /project/{key} and /project/{key}/versions using that same token. If those requests fail, the service account is being blocked before it even tries to create anything.
If those work but the POST fails, then you definitely have a permission or pathing issue.
Dear @b_nijhuis
Is 0 the Id of the project you wnat to add the version?
If not you need to specify the correct Id.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Has the service user permissions in the project? The user needs the Manage Versions (Releases) permission in that project
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.