Is there a more efficient way to fetch the users associated with all projects and issues?

Moxarth Rathod November 28, 2023

Hey Folks,

My use case is to fetch all users associated with all projects and issues present in the Jira software.

Consider having the large data present in the Jira software

Here is the method I am using to fetch permissions for projects:

Fetching project permission is still not a time-consuming task, the real nightmare is to fetch permissions for issues.

I am using the below way to fetch issue permission:

  1. If an issue security scheme is present, I am using /rest/api/2/issue/{issue_key}?fields=security endpoint which returns a security schema applied to the specific issue.
  2. Once, we get the issue security scheme, the next target is for scheme members and that is achieved via https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-security-schemes/#api-rest-api-3-issuesecurityschemes-level-member-get.
  3. This point is applied if issue security schema is not present/applied for an issue, the parent permission means the project's permission is inherited to the issue.

This is how we fetch the users for issues and it looks simple in the first place. But the problem arrives when there are thousands of issues available in projects, the API calls, in that case, are at peak.

Assuming we have 50 projects and each has 1000 issues then the total API calls for fetching issue permission is 50000 which slows down the resultant code.

Question: Is there a better approach to minimize the API calls or improve this method of fetching users/actors for projects and issues?

0 answers

Suggest an answer

Log in or Sign up to answer