everest
Blogs

Atlassian Development : Sample code to get the list of projects from your JIRA instance

Contact Us
Rajeev kumar1 min read

In this blog post, I will be sharing tips on how to populate a list of projects from your JIRA instance. The project list can be useful for features where you need to relate a particular issue to multiple projects or clone an issue under multiple projects.

Getting the list of projects from JIRA database is a fairly straight forward task. Follow these steps to get the list:

First import the required classes in your java file where you want to fetch all the current JIRA projects. Here are the commands for the importing files

  • import com.atlassian.jira.project.Project;
  • import com.atlassian.jira.component.ComponentAccessor;

Now in the file, where you need to get the list of all current projects, write the following code

  • List projects=ComponentAccessor.getProjectManager().getProjectObjects();

Here the object projects is an Array List of type com.atlassian.jira.project.Project. You can get all the information of the projects from this ArrayList. Simple enough?

Get Started

Have Questions? Let's Talk

Share a few details about your goals: a Mirketa consultant will follow up within one business day.

  • A specialist follows up within one business day
  • A no-obligation conversation about your specific goals
  • Answers from someone who actually works in this space
  • Your information stays confidential
Certified PartnerSOC 2 CertifiedHIPAA ReadyEnterprise Ready

Schedule a Free Consultation