Hi,
I’m desperately trying to call this API with Google Apps Script: Get issue limit report.
The documentation says to pass this parameter as payload this object: { “issuesApproachingLimitParams”: { “worklog”: 8000 }.
Unfortunately it seems that the UrlFetchApp class does not allow you to specify the payload in GET calls.
Anyway, I tried as follows and, obviously, it doesn’t work:
var url = "https://my-domain.atlassian.net/rest/api/3/issue/limit/report?isReturningKeys=true";
var params = { "issuesApproachingLimitParams": {"worklog": 8000} };
var options = {
method: "get",
muteHttpExceptions: true,
payload : JSON.stringify(params), // not recognized !!
headers: {
'Authorization': 'Basic ' + MY-TOKEN,
'Accept': 'application/json',
'Content-Type': 'application/json'
}
};
var req = UrlFetchApp.fetch(url, options);
This is because I’m trying to turn this CURL into a Google Apps Script function which instead works:
curl --request GET
--url 'https://my-domain.atlassian.net/rest/api/3/issue/limit/report?isReturningKeys=true'
--header 'Accept: application/json'
--header 'Authorization: Basic <MY-TOKEN>'
--header 'Content-Type: application/json'
--data '{ "issuesApproachingLimitParams": { "worklog": 8000 } }'
Is there anyone who can help me?
Thanks a lot in advance
Mike
Michele Fabbri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
4