I have an app (Forge Webtrigger) attempting to create an Organization and add it to a service desk project.
This involves 2 calls that I am executing asApp():
- Creating the Org - this works.
// Create new Organization
await api.asApp().requestJira(route`/rest/servicedeskapi/organization`, {
method: "POST",
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: name
})
});
- Adding the Org to a project - this is failing.
// Add Organization to Project
await api.asApp().requestJira(route`/rest/servicedeskapi/servicedesk/${project}/organization`, {
method: "POST",
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
organizationId: org_id
})
});
Docs:
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-servicedesk-servicedeskid-organization-post
According to the API docs, both calls ask for the manage:servicedesk-customer
scope, which my app has.
Adding the new Organization to a project results in the following error:
{
"errorMessage":"You'll need additional permission to manage organizations",
"i18nErrorMessage":{
"i18nKey":"sd.customer.organisation.error.manage.organisation.permission.violation",
"parameters":[
]
}
}
Is there an additional scope needed on top of manage:servicedesk-customer
? Or, what is the reason for this error?