Forums

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

How to retrive the objects from collections for jira?

xavier jir March 4, 2012

hi i retrived all the project by getProjects() method using atlassian api

ComponentManager cm=ComponentManager.getInstance();

ProjectManager dm=cm.getProjectManager();

dm.getProjects();

Next i would like to do to retrive the issues for that projects

so i need to retrive the objects which returns from dm.getprojects() method using iterator..

Please suggest me how to do that

1 answer

0 votes
Radek Kantor
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.
March 4, 2012

Hi,

use IssueManager and methods:

Collection<Long> getIssueIdsForProject(Long projectId)

MutableIssue getIssueObject(Long id)

More http://docs.atlassian.com/jira/latest/com/atlassian/jira/issue/IssueManager.html

xavier jir March 4, 2012

Sorry i didnt understand how to use these methods because now only i'm learning about this....

Can u please tell me a brief explanation about it how to use this with examples which can be understand to a begineer...

i want examples to getprojects from that projects i need to get the all the issues for that project.. is it possible to print that issues(If possible means pls tel with example)

xavier jir March 4, 2012

You have mentioned that to pass the project id for getissueidsforproject().. How to pass that project ids when i use getprojects() method?

Radek Kantor
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.
March 4, 2012

JIRA 4.4 pseudocode:

ProjectManager pm = ComponentAccessor.getProjectManager();
IssueManager im = ComponentAccessor.getIssueManager();
MutableIssue mi;
for (Project project : pm.getProjectObjects()) {
	for (Long issueId : im.getIssueIdsForProject(project.getId())) {
		mi = im.getIssueObject(issueId);
		// Some operations with issue object
		System.out.println("Project: " + project.getKey() + ", issue: " + mi.getKey());
	}
}

xavier jir March 4, 2012

hi it runs successfully.....but it does not print any thing about the projectkey and about the issue... Pls suggest me...

Radek Kantor
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.
March 4, 2012

Should be printed in Tomcat console - if code is a part of the plugin in bundled JIRA server, or use logger and check log files. There are many options how to check this, run in debug mode, populate to user view layer, ...

You are probably not a java developer, because these are bacis simple steps.

xavier jir March 4, 2012

yes sir, you are right. now only i'm learning about these...Thats why.. Dont mistake me...

xavier jir March 4, 2012


Sir Kindly please guide me how to get the due date for the issue.?????

Radek Kantor
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.
March 4, 2012

Use your brain and JIRA API, all you need is in MutableIssue object.

xavier jir March 4, 2012

Thank you sir......

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events