We used to fetch some sprint details (e.g., Name and EndDate) using a personal token and then URL https://OURSITE.atlassian.net/rest/agile/1.0/board/1/sprint.
As this token is expired, I wanted to switch to a service account. I learned that this requires a different URL scheme, https://api.atlassian.com/ex/jira/CLOUD_ID/API_ENDPOINT. This works fine vor v2/3 stuff (like rest/api/3/project or even rest/api/3/issue/PRJ-1234), but as far as I can see, v2/3 offers no access to Jira Software specific data, so I have to stick with the 1.0 API. But is this possible?? The obvious variant, i.e. using rest/agile/1.0/board/1/sprint, just returns a "401: Unauthorized; scope does not match", but I guess that's just because the URL is wrong (it returns for the same for rest/api/agile/1.0/issue/PRJ-1234, which works using v2/3 api).
So, am I missing something or is really not possible to get sprint details using the service account API??
Hi @Jakob
Can you tell what error did you get? Service account should be able to use API v1.
Regards,
Seba
when requesting
https://api.atlassian.com/ex/jira/%CLOUD_ID%/rest/api/agile/1.0/issue/%ISSUE%
the http error is a simple
HTTP/1.1 401 Unauthorized
with the output
{"code":401,"message":"Unauthorized; scope does not match"}
Same with rest/agile/1.0/board/1/sprint (from the personal token API) or any other 1.0 calls (and various combinations of rest, api, 1.0 vs. 1 etc.).
According to this post a possible reason is "it can’t find the route you are specifying", so maybe the URL is wrong or the agile/1.0 API is not supported, which would be a real pity and a serious limition of service accounts...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jakob
Please check doc what scopes need to be added to token - https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-rest-agile-1-0-board-boardid-get
I tested and it works for me when I will add right scopes selected.
Regards,
Seba
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks, after creating a token with the required scopes it actually works. I'm pretty sure I did the same before, but there must be something I did wrong along the way...
For future reference:
curl ^
--get ^
-H "Accept: application/json" ^
-H "Authorization: Bearer %TOKEN%" ^
-d "state=active" ^
--url "https://api.atlassian.com/ex/jira/%CLOUD_ID%/rest/agile/1.0/board/%BOARD_ID%/sprint"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jakob
The Jira Software API seems to not have "granular" (needed for service accounts or scoped tikens) options, so the endpoints, it only works with a personal API token.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When creating a token for the service account, I can also specify a "classic" scope named "read:jira-work", with which I can get issue data, at least with v2/v3.
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.