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 Leaders.
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

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 Leaders.
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 11 people like this

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events