Forums

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

How to get List of Issue Object using ProjectKey?

Ramesh Lakshmanasamy June 16, 2018

I need to know list of Issues in a Single Project Using java API.

2 answers

3 votes
Mark Markov
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 16, 2018

Hello @Ramesh Lakshmanasamy

Like this

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue

def project = ComponentAccessor.getProjectManager().getProjectByCurrentKey("TEST")
def issueids = ComponentAccessor.getIssueManager().getIssueIdsForProject(project.id)
List<MutableIssue> issueList
issueids.each {it ->
issueList.add(ComponentAccessor.getIssueManager().getIssueObject(it))
}
Ramesh Lakshmanasamy June 16, 2018

Thanks @Mark Markov i tried above solution its working fine.

Mark Markov
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 18, 2018

You re welcome. If it helps you, please mark answer as accepted :)

1 vote
Prakhar Srivastav {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.
June 16, 2018

Hi @Ramesh Lakshmanasamy

I will suggest you to use below method. It will give you a list of all issue ids with which you can create issue Objects.

https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/issue/IssueManager.html#getIssueIdsForProject-java.lang.Long-

There is one direct method to get all issue objects , but that is being deprecated :

https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/issue/IssueManager.html#getProjectIssues-org.ofbiz.core.entity.GenericValue-

you can use jql via java api as well.

 

Regards

Prakhar

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira service management, jsm webinar, ai in jsm, opsgenie integration, incident management, virtual agent, atlassian intelligence, ai-powered service desk, it operations, atlassian learning, service management webinar, team '25 recap

What’s new in Jira Service Management 🤔

Discover how Atlassian is revolutionizing service management with cutting-edge solutions for AI-powered support, HR Service Management, or DevOps connectivity.

Register here ⬇️
AUG Leaders

Atlassian Community Events