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

How to get severity name??

Hello 


 
i will try workItem.getSeverity() and return identifier

but, i want get name ex(major)

0 votes



3 answers

Permanent link

 Hi,


You could refer the below link on getting attribute values under "Getting the Work Item’s Attributes in the API"

Regards,
Bharath

0 votes


Permanent link
If you are working with server-side Java API, try this code.
I've used it to retrieve the values of many enumeration attributes; it should work for the Severity attribute as well:

IAttribute attribute = ...;
Identifier<?> enumerationIdentifierValue = ...;
IWorkItemCommon workItemCommon = ...;
IProgressMonitor monitor = ...;
String identifierName = "";

while (identifierName.isEmpty()) {
IAttributeHandle attributeHandle = (IAttributeHandle) attribute.getItemHandle();
IEnumeration<?> enumeration = workItemCommon.resolveEnumeration(attributeHandle, monitor);
List<?> literals = enumeration.getEnumerationLiterals();
for (Iterator<?> literalsIterator = literals.iterator(); literalsIterator.hasNext();) {
ILiteral iLiteral = (ILiteral) literalsIterator.next();
if (iLiteral.getIdentifier2().toString().equals(enumerationIdentifierValue.toString())) {
identifierName = iLiteral.getName();
break;
}
}
}

0 votes


Permanent link

 

thanks

i will try get customer attribute name

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
× 10,954

Question asked: Dec 05 '19, 11:26 p.m.

Question was seen: 1,621 times

Last updated: Dec 06 '19, 2:47 a.m.

Confirmation Cancel Confirm