JIRA Groovy Script - How To Get All Issues For A Project

Do you like this?

This script shows you how to get all Issue objects for a project.


Suppose we have a project with its key as "Project_Key". To know your project's key, go to Administration -> Projects -> Edit.

import org.ofbiz.core.entity.GenericValue;

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.project.Project;
import com.atlassian.jira.project.ProjectManager
def ret=[]

ProjectManager projectManager = ComponentManager.getInstance().getProjectManager()
Project proj= projectManager.getProjectByCurrentKey("Project_Key")

IssueManager issueManager=ComponentManager.getInstance().getIssueManager()
for (GenericValue issueValue: issueManager.getProjectIssues(proj.genericValue)){
	Issue issue= issueManager.getIssueObject(issueValue.id)
	ret.add issue

return ret

comments powered by Disqus