I’m trying to use Get Organizations API .
const productAuthHeader = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-Force-Accept-Language': 'true',
'Accept-Language': 'en'
}
const getOrganizations2 = async(serviceDeskId, data) => {
let url = `/rest/servicedeskapi/servicedesk/${serviceDeskId}/organization?`;
Object.keys(data).map(key => {
url = url + key + "=" + data[key] + "&"
});
console.log(url);
const res = await api.asUser().requestJira(route`${url}`, {
headers: productAuthHeader,
});
But it results in an error below.
rest/servicedeskapi/servicedesk/<MYPJ>/organization?accountId=<myID>&
"OAuth 2.0 is not enabled for method: GET /rest/servicedeskapi/servicedesk/<MYPJ>/organization%3FaccountId=<myID>&"
The url value passed to console.log is correct.
But it is altered after it is passed to requestJira().
It seems that “?” is converted to “%3F”.
Why?