Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Need pagination in REST if there is no pagination params in the response or header.

prashanthreddy
New Contributor III
New Contributor III

Hi All,

I'm trying to integrate JIRA CLOUD application as REST integration in 2023 version and I'm not able to import accounts through pagination as i don't find related pagination logics in the example jsons. 

 

Issue at hand:

Response has no pagination params. response and responnse header does not have any useful pagination parameters to use.

 

Please find the attached log snippet and importAcctJson

Any help on this would be really appreciated.

8 REPLIES 8

RakeshMG
Saviynt Employee
Saviynt Employee

Please try using following sample

"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?.next_page==null?null:response.completeResponseMap.next_page}"
}
}

Use the value in the response to paginate into the next pages if the next_page attribute contains a value, else the pagination stops

Refer to following document : https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm


​Regards

Rakesh M Goudar

prashanthreddy
New Contributor III
New Contributor III

Hi Rakesh,

 

Thanks for the response, I still see the below error:

 

{"log":"04-May-2023 15:39:07.510 WARNING [quartzScheduler_Worker-7] groovy.sql.BatchingStatementWrapper.processResult Problem executing batch - expected result length of 1000 but got 0\n","stream":"stderr","time":"2023-05-04T15:39:07.511009209Z"}"

SB
Saviynt Employee
Saviynt Employee

Can you try with the below and see if it works. This is created based on the pagination example given on https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#special-request-headers

Hope you are integrating the same.

{
"pagination": {
"page": {
"pageSizeParam": "maxResults",
"pageSize": 50,
"pageRecordCount": "completeResponseMap.maxResults",
"pageNumberParam": "startAt",
"totalCountPath": "completeResponseMap.total",
"firstPageNumber": 0
}
}
}


Regards,
Sahil

prashanthreddy
New Contributor III
New Contributor III

Hi Sahil,

I do see this in connector reference document but it doesnot work either.

 

https://docs.saviyntcloud.com/bundle/Atlassian-v2022x/page/Content/Understanding-the-Integration-Bet...

SB
Saviynt Employee
Saviynt Employee

Can you update ConfigJSON param in the REST connection with value {"showLogs":true} if not done already. Run the import and share the log snippet.


Regards,
Sahil

prashanthreddy
New Contributor III
New Contributor III

Hi Sahil,

 

I was able to achieve the pagination by removing the duplication of  pagination params in the url (harcoded)

Can you share the final format you are using.


Regards,
Sahil

prashanthreddy
New Contributor III
New Contributor III

Sure here is my pagination block:

 

"pagination": {
"offset": {
"offsetParam": "startAt",
"batchParam": "maxResults",
"batchSize": 100,
"totalCountPath": xxxx
}

 

 

and URl: https://xxxx/rest/api/3/users/search - right way to use when you have pagination, 

 

I was duplicating https://equifax-sandbox-525.atlassian.net/rest/api/3/users/search?startAt=0&maxResults=xxx in the url even though I have pagination logic.