I am unable to call Rest API "Get issue limit report" with Google Apps Script

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:
{ “issuesApproachingLimitParams”: { “worklog”: 8000 }

Unfortunately, the UrlFetchApp class does not allow you to specify the payload in GET calls,
so I’m forced to pass them in the query string.

I’ve tried in many possible ways but I can’t. This is an example:

https://my-domain/rest/api/3/issue/limit/report?isReturningKeys=true&issuesApproachingLimit[worklog]=8000 (obviously encoded)

Can anyone tell me the correct query string ?

Thanks a lot in advance

Mike

1 Like

Hello @michelefabbri

Unfortunately, it seems you cannot pass those parameter values in the query path, since they are collectively nested inside the issuesApproachingLimitParams object, so you must provide them in the request body.

IMHO GET requests shouldn’t pass parameters values via the body. This has been a hotly debated topic and an unwritten rule for REST APIs for decades. Google obviously agree.

This new endpoint also breaks all of Atlassian’s own rules about their API endpoint formats, as I’m fairly sure no other GET endpoint in the entire Jira REST API set passes parameters in the request body.

I don’t think the Jira API team has thought this through… IMHO

rant
ALSO… little syntax things like one parameter field being remoteIssueLinks (uppercase for each word after the first one) but another being issuelinks (all lowercase) just tick me off! Be consistent; if you’re going to use uppercase for each word, do it always, not just sometimes, at random.
/ rant

1 Like

Hi @sunnyape ,
Thanks a lot for your opinion…I thought I wasn’t capable.

I’m forced to change programming language and operating environment.

Thanks again.
mike

1 Like