Use Jira OAuth 2.0, when redirect to
Select a site from Use app on dropdown list, got all sites from response data:
const apiUrl = `https://api.atlassian.com/oauth/token/accessible-resources`;
const headers = {
Authorization: `Bearer ${accessToken}`,
Accept: "application/json",
};
fetch(apiUrl, {
headers: headers,
})
.then((response) => {
return response.json();
})
.then((data) => {
console.log(data);
});
Response:
[
{
id: 'id1',
url: 'https://site1.atlassian.net',
name: 'org1',
scopes: [
'read:jira-work'
],
avatarUrl: 'png1'
},
{
id: 'id2',
url: 'https://site2.atlassian.net',
name: 'org2',
scopes: [
'read:jira-work'
],
avatarUrl: 'png2'
}
]
How to get cloudid(site id) which user selected? I didn’t find a valid value from callback data.
If can’t, why provide the dropdown list option?
