Hi,
I am trying to hit a third part API, to get the usernames and store these information into Jira Insights.
The third party API, returns only 50 results at a time (pagination).
How can I use Jira automation to incrementally go voer this API and get the results. For e.g.
When the jira automation runs for the first time, it gets 50 usersname, and stores in JIra insights, then it runs again but this time hits the api, and page 2 to get the 51-100 usernames and so on
Please suggest.
@Pravin -
Since it is dealing with a third party API calls, you need to contact the vendor of the APIs for suggestion and support. The behavior of the APIs returning the results is not controlled within JSM, thus automation rule has no ways to change the returning results pagination process.
Sorry.
Best, Joseph Chung Yin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Pravin -
Unfortunately, it is not possible to use automation rule to obtain all of your results from the the third party APIs.
However, if in their APIs, you can specify the result set (i.e. something like 2nd 50 results, 3rd 50 results) being returned, then you may be able to conduct multiple Webrequest actions in the rule, obtain the results then update a local variable for the rule with the result set. Once you obtained all results and they are in the local variable, you should be able to use the local variable content for your Jira Insight updates...
Hope this makes sense.
Best, Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
they do have the option in there API endpoint:
&page=1&size=50
So is it possible to iterate this API with increasing the page number by 1 on each run until all results are received?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Incrementing the page parameter is almost certainly the intention of the author.
I don't have a strong opinion around changing the page size, but making the page size larger can sometimes be faster overall since you send fewer requests.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.