Use the Pagination Concept in an Integration

When you must fetch a large number of results in Jira, you can use the Jira Adapter’s pagination feature. Pagination helps you segregate the total number of results. You can specify the number of results per page according to your requirement while triggering an integration and receive sorted results.

This use case describes how to use pagination to sort results while fetching product results. Similarly, you can use pagination for the Issue attachments object, Issue comments object, and Users object. To perform this operation, you create an integration for the Jira Adapter in Oracle Integration using pagination with the orchestrator.

  1. Create a scheduled orchestrated integration.
  2. Drag an assign action to the workspace.
  3. Provide a unique name for this action, and click Create.
  4. Assign the following two variables to your integration. Specify the values to variables as follows.
    $startAt="0"
    $Max ="2"
    $Flag="false"
  5. Click Validate, and then click Close.
  6. Drag a while action below the assign action.
  7. Provide a unique name for this action, and click Create.
  8. Set the condition for the specified variables as follows.
    $Flag !="true"
  9. Click Validate, then click Close.
  10. Drag a Jira Adapter inside the while action.
  11. Specify the following details in the Adapter Endpoint Configuration Wizard.
    1. On the Basic Info page, provide an endpoint name, and click Next.
    2. On the Actions page, select Query, and click Next.
    3. On the Operations page, select the Projects as an object, and select Search Projects as an operation.
    4. On the Summary page, review your selections, and click Done.
  12. In the mapper, map $Max to maxResults and $startAt to startAt.
  13. Drag an FTP Adapter connection and configure the FTP endpoint to write the response to a file.
    1. On the Basic Info page, provide a name, and click Next.
    2. On the Operations page, select Write File from the Select Operation list.
    3. Select Binary in the Select a Transfer Mode field.
    4. Specify the output directory, file name pattern, and download directory, and click Next.
    5. On the Scheme page, select No in the Do you want to specify the structure for the contents of the file field, and click Next.
    6. Review your selections on the Summary page, and click Done.
  14. Perform the required mapping.
  15. Drag a switch action and specify the following IF condition:
    contains( nextPage, "startAt") = "true"
  16. Drag an assign action to update the specified variables as follows:
    startAt + $Max
  17. Drag an assign action into the Otherwise branch of the switch action to update the specified variables as follows:
    $Flag="true"
  18. When complete, save and activate the integration.
    The completed integration looks as follows.
    This integration shows a schedule, an assign action, a while loop, a mapper, a Jira Adapter, a mapper, an FTP Adapter, and branching logic with an IF condition branch and an Otherwise branch.

  19. After successful activation, you can submit the integration and monitor the runtime in Oracle Integration. The integration keeps running until it completes all cycles of fetching project results, respectively, to each page in the FTP location.