OAuth 2.0 Not Enabled for this Method when including query params

Hi there, I’ve been experiencing some issues with including query parameters in my Forge App. According to this endpoint here, to get all sprints in a board, I have the option to pass in query parameters, like so. I would like to obtain all of the current active and future sprints in a board.

const route = route`/rest/agile/1.0/board/{boardId}/sprint?state=active,future`
const res = api.asUser().requestJira(route, {
    method: "GET",
    method: req.method,
     headers: {
        "Content-Type": "application/json",
      },
})

This gives me the error in the title, but if I were to remove query params, the endpoint would simply fetch all sprints in the board with success. I’m a bit confused by the different authentication methods in the documentation, could anyone simplify it for me? Am I using the wrong authentication method here?

Best regards,
Zach Khong

Hi @ZachKhong ,
You’ll need to add the scopes mentioned in the doc under that request to the manifest.

permissions:
  scopes:
    read:sprint:jira-software

You can also check and fix for any missing permissions you may have with forge lint --fix

1 Like

Hi @QuocLieu,
I already have that enabled, but turns out the problem was using the tagged template literals like so. Found a similar thread with exactly what I needed, https://community.developer.atlassian.com/t/forge-api-ignores-query-string/60600/2

const url = `/rest/agile/1.0/board/{boardId}/sprint?state=active,future`
const route = route`${url}`

I should have made it more clear in the example that the above was what I was doing instead. Thanks for your help anyways!

1 Like