Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

find severity name of a WorkItem

If I have a work item, it's easy to get the ID of the severity assigned:

Identifier<ISeverity> theSev= theDefect.getSeverity();
String sevName = theSev.getStringIdentifier();

(for example, this will give a value such as severity.literal.l6)

But I don't see how to get the display name of the severity, such as "Blocker", since I don't see how convert the Identifier<ISeverity> object to the ISeverity object itself.

I can go the other way! If I have an ISeverity object, I can get the Identifier:

ISeverity iAmBlocker theSev ...
String blockersName = theSev.getName //"Blocker"
Identifier<ISeverity> blockersID = theSev.getIdentifier2();
String blockerIDName = blockersID.getStringIdentifier(); //"severity.literal.l6"

But given a work item, how do I find out if it's severity is "Blocker"?

0 votes



One answer

Permanent link
You can use the following (with projectArea= workItem.getProjectArea()):

IWorkItemClient workItemClient= (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);
IAttribute severityAttribute= workItemClient.findAttribute(projectArea, IWorkItem.SEVERITY_PROPERTY, null);
IEnumeration<ISeverity> severityEnumeration= (IEnumeration<ISeverity>) workItemClient.resolveEnumeration(severityAttribute, null);
ISeverity severity= severityEnumeration.findEnumerationLiteral(severityIdentifier);

Note that 'severity' might be null because the user can remove literals from an enumeration that are already in use.

Regards,

Christof
Jazz Work Item team

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 11,079

Question asked: Jul 24 '08, 12:45 p.m.

Question was seen: 10,182 times

Last updated: Jul 24 '08, 12:45 p.m.

Confirmation Cancel Confirm