Skip to main content
Skip table of contents

Local Jira - All Projects

This example demonstrates how to retrieve all projects from a local Jira instance using pagination.

Prepare a Data Source

We utilize the /rest/api/2/project/search endpoint to retrieve all projects. However, this endpoint only provides 50 projects at a time. To enable pagination for this endpoint, we include the startAt variable in the following manner:

CODE
/rest/api/2/project/search?status=live&startAt={start}

Shows the URL in the actual data source form

Setting up the Paginated Data Source

To create a new data source and utilize the Paginated Data Source type, you need to first choose the data source for pagination and then specify the pagination type. In this scenario, we opt for Offset-based and select the previously established start variable in the Offset Variable section.

The Result Selector will target the list of items that are of interest:

CODE
$.values[*]

For the Finish Condition, it is controlled by the value returned by each page referred to as total. Once again, we employ a JsonPath to designate the Finish Target :

CODE
$.total

Please refer to the following screenshot for a complete view of this setup:

Shows the complete pagination data source setup

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.