Getting a list of all sprints

Is it possible to get board / sprint information using v2 / v3 API?

If not and I have to use v1 I’m running onto a 401 issue with my get request. I know the token is valid since it works for v3. Is this the correct url?

https://mycompany.atlassian.net/rest/agile/1.0/board
or
https://mycompany.atlassian.net/rest/agile/1.0/board/5/sprint

  • I replaced my resource id with mycompany

Hello @DavidBroadhurst

The REST API for Jira Cloud SOFTWARE (the add-in the provides the Agile functionality) is at v1.0. There is no v2 or v3 version of it, that is the underlying Jira Cloud REST API.

The documentation is missing the information required to get all boards from a project using the Get board endpoint. It’s done like this:

GET:
https://{JiraCloudInstanceHere}/rest/agile/1.0/board?projectKeyOrId={projectKeyOrIdHere}

1 Like

@sunnyape Thanks for the quick response but still getting a 401 from browser and curl. Are these the correct scopes?

&scope=offline_access read:jira-work read:jira-user

Here’s my curl

curl -H “Accept: 'application/json” -H “Authorization: Bearer my-token-that-works-for-v3” https://mycompany.net/rest/agile/1.0/board\?projectKeyOrId\=“UN”
{
“code”: 401,
“errorMessage”: “Unauthorized”
}

Tried the projectId with and without quotes. Also tried ?project. ?projectId and ?ProjectKey

Hello @DavidBroadhurst

No idea. It’s working fine for me. Here’s my test via Postman:

This is just a plain Basic auth session with all the parameters in the single URL and no body, additional scopes or anything else.

The Jira software rest api’s have their own detailed scopes. Check the link above to find out the one for reading sprints.

I’ve updated the granular scopes and see the image below when granting authorization

I’m also setting the scopes when requesting access

&scope=offline_access read:jira-work read:jira-user read:sprint:jira-software read:board-scope:jira-software read:issue-details:jira

Still getting a 401 when requesting - /rest/agile/1.0/board?projectKeyOrId=UN

So far I don’t seem to be able to access any v1 endpoints but using the same Bearer token all v2/v3 endpoints work.

Should I be using a different URL to get the token? Currently using - Log in with Atlassian account

I’ve also set the distribution status to shared

I can confirm using an API key works as expected but just switching from basic auth to bearer token in postman with a token that works in v2/v3 returns a 401. Can anyone confirm they are able to get response from v1 api using a bearer token?

Hi @DavidBroadhurst,

Jumping into the party :slight_smile: Yes, I can confirm that I was able to successfully call a Jira Software REST API using a bearer token on Postman (see the image below).

If you are getting a response of HTTP 401, one possible reason is an incorrect request URL. Using basic auth, you use https://myinstance.atlassian.net/{api} however, using OAuth 2.0 the URL should be in this format https://api.atlassian.com/ex/jira/{cloudid}/{api} (see reference doc for more info).

As for the scopes, here’s the list that I’ve used in this test run (there are probably some unnecessary scopes here as I am using this token for multiple tests)

          [
              "read:issue:jira-software",
              "read:issue-details:jira",
              "read:user:jira",
              "read:application-role:jira",
              "read:avatar:jira",
              "read:group:jira",
              "read:board-scope:jira-software"
          ]

I hope this helps.

Ian

Thanks for the help everyone, issue resolved now.

  1. Needed granular scopes for v1 api’s

  2. For some reason I thought v1 required the basic auth url and not the token url.