Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Getting issuetype base on its name (not ID)

Mateusz Szafarz September 2, 2013

Can you help me with getting IssueType object base on its name and not ID as in com.atlassian.jira.config.IssueTypeManager:getIssueType method? I have no idea how to do it. Do i have to get all issue types and then retrive specific type from returned collection?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

4 votes
Answer accepted
RambanamP
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.
September 2, 2013

try with this code

int issueTypeID = -1;
Collection<IssueType> issueTypes = ComponentAccessor.getConstantsManager().getAllIssueTypeObjects();
for (Iterator<IssueType> itr = issueTypes.iterator(); itr.hasNext();) {
	IssueType tmpIssueType = (IssueType) itr.next();
	if ((tmpIssueType.getName()).compareToIgnoreCase("Defect")) {
		issueTypeID = Integer.parseInt(tmpIssueType.getId());
		break;
	}
}

TAGS
AUG Leaders

Atlassian Community Events