For Server/Data Center, there’s the Script Editor menu to write scripts for reuse. In Cloud, there’s no more Script Editor. How can I achieve the same effect?
In particular, I want paging to be handled transparently. If you take a look at the Jira Cloud REST APIs, you will be surprised by how many different styles they got.
e.g. Issue search (api-rest-api-3-search-get)
Takes: startAt, maxResults
Outputs: startAt, maxResults, total
e.g. Get dashboards (api-rest-api-3-dashboard-get)
Takes: startAt, maxResults
Outputs: startAt, maxResults, total… plus next and prev containing URLs
e.g. Get filters (api-rest-api-3-filter-search-get)
Takes: startAt, maxResults
Outputs: startAt, maxResults, total… plus isLast and nextPage
e.g. Search users (api-rest-api-3-user-search-get)
Takes: startAt, maxResults
Outputs: Nothing except the current page of results, won’t even tell you the total, just try to get next page to see if you got everything
Even more styles if you look at Confluence Cloud REST APIs. The one for content restriction is a real gem. Some APIs don’t even return a correct total.
Instead of repeating these pagination handling all over the place, I really need a centralized script to deal with them.
How can I achieve the same effect as Script Editor in Cloud?