Forums

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

How to get project names in jira plugin development?

Nageswarara Rao
Contributor
June 30, 2013

Hi,

i want to get all the project names into a dropdown menu in my plugin , Is there any way to get the project names ,pls help me to do this

2 answers

1 accepted

7 votes
Answer accepted
David at David Simpson Apps
Atlassian Partner
June 30, 2013

Inject ProjectManager into your plugin code and use projectManager.getProjectObjects() to get a list

https://docs.atlassian.com/jira/latest/com/atlassian/jira/project/ProjectManager.html#getProjectObjects()

Or just get the component:

ProjectManager projectManager = 
      ComponentManager.getComponentInstanceOfType(ProjectManager.class);
Collection<Project> projects = projectManager.getProjectObjects();

1 vote
Dipti Ranjan Behera
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.
June 30, 2013

Hi Nageswarara,

Please use this API : ComponentAccessor.getProjectManager().getProjectObjects()

in the UI : traverse the project list and use apis of project object class


anas bakhou March 12, 2015

Hi Please can i have pom dependencies for deploying the Project Manager interface

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events