The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to find all the project leads in jira server through jira api?

Santwana Sarangi {Appfire}
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 30, 2018

I need to list all users who are lead of one or more projects in Jira server using Jira API.

For example,

There two projects in the Jira server projA and projB and userA and userB are the project leads of projA and projB respectively, then the result should return a list containing userA and userB

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 30, 2018

If you want to user REST API then you should:

1. Get all projects with GET /rest/api/2/project

https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-project-get 

2. Iterate over all projects and get component lead for each project GET /rest/api/2/project/{projectIdOrKey}

https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-project-projectIdOrKey-get

If you want to use Java API then 

1. Get all projects

ComponentAccessor.getProjectManager().getAllProjectKeys()

2. Get component Lead for each project with getProjectLead() function.

Konstantin Gapich
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 26, 2018

Or you can just send:
`/rest/api/2/project?expand=lead`

Like # people like this
TAGS
AUG Leaders

Atlassian Community Events