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: 

Groovy: how to get all projects?

ioann sys
November 4, 2017

Hello!

Can I take list of JIRA projects? I need change a project leader on all projects.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

5 votes
Answer accepted
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.
November 4, 2017
import com.atlassian.jira.component.ComponentAccessor
def prList = ComponentAccessor.getProjectManager().getProjectObjects()
ioann sys
November 4, 2017

Alexey, thank you!

Rene Asanga
November 18, 2019

Hello Alex, 

Could this be modify to get the projects numbered, so it's easier to do the count. 

Thanks.

Maha vishnu v
May 7, 2020

Hello @Alexey Matveev  , 

 

Can you please provide code to ,Get the list of project name ? 

Above code provides Project key .

 

Thanks .

Eric Collins
Contributor
February 3, 2021
import com.atlassian.jira.component.ComponentAccessor
def prList = ComponentAccessor.getProjectManager().getProjectObjects().name
Like # people like this