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:
/rest/api/2/project/search?status=live&startAt={start}
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:
$.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
:
$.total
Please refer to the following screenshot for a complete view of this setup: