How to get severity name??
![](http://jazz.net/_images/myphoto/9b59b38bb60cb648c2f5f3a0350a0a42.jpg)
3 answers
![](http://jazz.net/_images/myphoto/9b59b38bb60cb648c2f5f3a0350a0a42.jpg)
Hi,
You could refer the below link on getting attribute values under "Getting the Work Item’s Attributes in the API"
Regards,
Bharath
![](http://jazz.net/_images/myphoto/9b59b38bb60cb648c2f5f3a0350a0a42.jpg)
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;
}
}
}