Hi,
I’m working on migrating an app from connect to forge, on connect we are calling this api with just the projectKeyOrId query parameter and it works fine.
On forge we are trying to do the same
requestJira(route`/rest/agile/1.0/board?projectKeyOrId=${projectId}`) but we receive this error Error: sprint filter: issue belongs to no board
I don’t see why it should work differently on forge so i would assume that this is a bug.
Thank you,
Diego.
Hi @diegorillosi
Maybe with requesJira you don’t have some acces to sprint.
try this:
const res = await api.asUser().requestJira(
route/rest/agile/1.0/board?projectKeyOrId=${projectId}
);
or asApp(), but asApp has less permission.
and check in your manifest if you have at least this:
permissions:
scopes:
Hi @FlixAndre
That’s exactly what we are doing, we tried both the asUser and asApp, yes i had to added the read:jira-work scope but in that case we were receiving an unauthorised error.
The error i receive in this case Error: sprint filter: issue belongs to no board looks related to something else, i don’t even know which issue the message is referring to.
Thanks,
Diego
For the authorisation, after changing your manifest, you need to do forge deploy, and forge install --upgrade
Maybe we can check more details on your request, can you do this:
const res = await api.asUser().requestJira(
route/rest/agile/1.0/board?projectKeyOrId=${encodeURIComponent(projectId)}
);
const text = await res.text();
console.log(‘URL:’, res.url);
console.log(‘Status:’, res.status, res.statusText);
console.log(‘Body:’, text);
console.log(‘Headers:’, Object.fromEntries(res.headers.entries()));
The error is strange because you want a list of boards or an empty list, I don’t understand why you have this error.
Hello @diegorillosi
yes i had to added the read:jira-work scope but in that case we were receiving an unauthorised error.
You haven’t actually said what scopes you have declared in your manifest, but the scopes required for that endpoint are described in the documentation as being:
OAuth 2.0 scopes required:
read:board-scope:jira-software, read:issue-details:jira
Once you have confirmed you have used the correct scopes, I would recommend that you start by using the web GUI and open each Board in that Project one at time and see if one of the Boards has a faulty JQL filter that is causing the problem, then use the Get a Board endpoint to see if the error message is repeated by the API for that specific Board.
Also, use an API test tool like Postman to isolate if the problem is with your request structure, the OAuth scopes, the endpoint itself or something that Forge is doing with the request.
Hi @FlixAndre
it was the install –upgrade step that i have missed, after that everything started working.
Thanks for the support!
Diego.
1 Like