Hello
I’m trying to add organizations to projects using rest .
it works with python script but when i try to include the functionality in my developed application it doesn’t work. I don’t get any errors and the app doesn’t crash, but the organization doesn’t get added. I can create a new organization, but I cannot add an existing organization to the project.
Also the answer is presented as [Promise], I was not able to get a more informative answer.
My code is:
async function addOrganizationToProject(orgId,projId) {
const bodyData = `{
"organizationId": ${orgId}
}`;
const response=""
const data=""
fetch( response = await api
.asUser()
.requestJira(route`/rest/servicedeskapi/servicedesk/`+projId+`/organization`, {
method: "POST",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
"X-ExperimentalApi": "true",
},
body: bodyData
})
)
.then(data => response.json())
.then (data => {console.log(data)
return data
})
Where i’m wrong?
Thanks in advance