Fetching all the data for a specific project

Hi all,

I’m new to this Jira cloud development, could anyone guide how can I fetch all the data for a selected project through a cloud api’s

  1. Is it possible to fetch all the data of issues - Epic, Feature, story, Test.
  2. If not, how can i reduce the number of api’s.
  3. How can i break the cyclical link between the issues to one another.

If anyone has fetched the entire data for a project using Jira cloud api’s and JQL please reply I have some queries to ask.

It will be helpful if someone provides links to solutions to my issue.

Thanks

Hey yeah, I’ve got something which works but has recently had some problems for me.

Query URL: https://{YOURORG}.atlassian.net/rest/api/3/search/jql?jql=project={YOURPROJECT}&expand=changelog,names&maxResults=100&startAt=1

Replace the {} fields with the values specific to your organization and project. The maxResults and startAt are for looping through when there are lots of results.

For me the expand = names used to return the display names for the column, but since the /search endpoint was deprecated it doesn’t seem to be working with the new search/jql endpoint. Not sure if anyone knows what the situation is there.

Hello @DavidRattray

Firstly, please don’t ‘hijack’ someone else’s question with a totally different question about a totally different problem that you are having.

but since the /search endpoint was deprecated it doesn’t seem to be working with the new search/jql endpoint.

I cannot replicate that. Using the expand=name parameter with the new JQL search endpoints returns the field names, exactly as documented.

The maxResults and startAt are for looping through when there are lots of results.

That is not correct. The new JQL endpoints do not use the startAt parameter to ‘loop through results’, and using that parameter in a GET style request will do absolutely nothing; the parameter is simply ignored.

The new pagination mechanism of the new JQL search endpoints is very well documented and has been widely discussed in many forums, especially the public Jira Community forum. I recommend that you do a basic Google search on the topic and read both the documentation and those discussion forum threads.

I was able to get the endpoint to fetch all issues, but the current challenge is implementing a way to trace all the issue links to generate the RTM (Requirement Traceability Matrix) report.

The goal is to retrieve all issues within a project, with an optional filter for version. If no version is selected, it should fetch all issues by default.

The required hierarchy flow is: Epic → Feature → Story → Test → Execution → Bug.

My proposed approach is to use hierarchical traversal, starting from high-level issues (for example, Epics) and recursively fetching all their linked issues down the chain.

[ Epic ]

├──> [ Story 1 ]
│ └──> [ Test A ]
│ └──> [ Test Execution 1 ]

├──> [ Story 2 ]
│ ├──> [ Test B ]
│ └──> [ Test C ]

But this may lead to many api call to Jira api’s and the Xray APIs for the test-related data any input on this. It would be helpful.

Thanks

Yep, that’s how to do it.

But this may lead to many api call to Jira api’s and the Xray APIs for the test-related data

Yep, it sure will.

any input on this. It would be helpful.

I have no further input, as you have perfectly understood the process of how to fetch all the data in a specific project. Well done!

Have fun!

1 Like

I’m concerned about the rate limits of the Jira and Xray APIs, as fetching all the issues through this process might result in increased response time.

I have two scenarios:

  1. When all versions are considered by default (if no specific version is selected in the filter).

  2. When a particular version is selected.
    Do you have any inputs or suggestions on how to handle these cases?

Thanks.

Hello @SRSagar

Your concerns about the rate limits are well founded; fetching “all the issues through this process” will be resource intensive, which in turn might possibly bring you close to the rate limits.

Do you have any inputs or suggestions on how to handle these cases?

I suggest that you refer to the detailed instructions in the REST API rate limit documentation on how to ensure your app’s requests stay below the limit, then refer to the section of the documentation about what to do if you get a warning that you are approaching the limit and how to back off.

I think I’ll leave it up to you to conduct any further research on this topic that you need.

Good luck!

Since it’s resource-intensive, do you know of any alternative way to fetch all the issues with specific fields?

Hi,

I’m trying to fetch data across multiple pages using the nextPageToken. Even though I’m using the token within a few seconds of it’s generation, the API still returns the following error response. - “The provided next page token is invalid or expired.”

The endpoint I’m using is → https://my-domainatlassian.net/rest/api/3/search/jql?nextPageToken=

If anyone has faced this issue before or knows the solution, please let me know- any help would be appreciated.

Thanks.

Hi all,

Are the JQL query APIs are working fine for the Sandbox project’s whatever the body I give it’s giving "Invalid request payload. Refer to the REST API documentation and try again.

curl --request POST \
–url https://mysandbox-domain.net/rest/api/3/search/jql \
–header ‘accept: application/json’ \
–header ‘authorization: Basic base64(mail:token’ \
–header ‘content-type: application/json’ \
–data ‘{
“queries”: [
{
“jql”: “project = project_name”,
“startAt”: 0,
“maxResults”: 5,
“fields”: [
“key”,
“summary”,
“issuetype”
]
}
]
}’
please let me know if there is any mistake in my body.
The actual JQL query that I want “project = “project_naem” AND type = Epic ORDER BY created DESC”

since it’s not working I’m check the simple one that’s just the project_name.

Thanks