How to get severity name??
![]() Hello
i will try workItem.getSeverity() and return identifier
but, i want get name ex(major)
|
3 answers
![]() Hi,
You could refer the below link on getting attribute values under "Getting the Work Item’s Attributes in the API"
Regards,
Bharath
|
![]()
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;
}
}
}
|
|
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.