How to get the story point values using server side API ?
Hello team
I want to get the story point values of a workitem story using server side API.
Below is the code which i used (referred from
https://rsjazz.wordpress.com/2012/08/20/manipulationg-work-item-enumeration-values/ ).
please let me know where I have gone wrong ?
if(attribute!=null && child.hasAttribute(attribute)){
Object objval = child.getValue(attribute);
if (objval instanceof Identifier) {
Identifier literalID = (Identifier) objval;
Notifications.addWarning("story point value '" + "'. check here ");
ILiteral literal = getLiteralbyID(literalID, attribute);
String displayValue = literal.getName();
}
private static ILiteral getLiteralbyID(Identifier findLliteralID, IAttribute attribute) throws TeamRepositoryException {
IEnumeration enumeration = fWorkItemCommon.resolveEnumeration(attribute, null);
List literals = enumeration.getEnumerationLiterals();
for (Iterator iterator = literals.iterator(); iterator.hasNext();) {
ILiteral iLiteral = (ILiteral) iterator.next();
if (iLiteral.getIdentifier2().equals(findLliteralID)) {
return iLiteral;
}
}
return null;
}
I want to get the story point values of a workitem story using server side API.
Below is the code which i used (referred from
https://rsjazz.wordpress.com/2012/08/20/manipulationg-work-item-enumeration-values/ ).
please let me know where I have gone wrong ?
if(attribute!=null && child.hasAttribute(attribute)){
Object objval = child.getValue(attribute);
if (objval instanceof Identifier) {
Identifier literalID = (Identifier) objval;
Notifications.addWarning("story point value '" + "'. check here ");
ILiteral literal = getLiteralbyID(literalID, attribute);
String displayValue = literal.getName();
}
private static ILiteral getLiteralbyID(Identifier findLliteralID, IAttribute attribute) throws TeamRepositoryException {
IEnumeration enumeration = fWorkItemCommon.resolveEnumeration(attribute, null);
List literals = enumeration.getEnumerationLiterals();
for (Iterator iterator = literals.iterator(); iterator.hasNext();) {
ILiteral iLiteral = (ILiteral) iterator.next();
if (iLiteral.getIdentifier2().equals(findLliteralID)) {
return iLiteral;
}
}
return null;
}
One answer
Since you don't explain what the problem is you have, how could any one answer that question?
I would also suggest to look at the object that you get for stories in a debugger. Based on that you can decide what you get and what to do with it. the link above has a link to a blog that explains how to set up for debugging.
I would also suggest to look at the object that you get for stories in a debugger. Based on that you can decide what you get and what to do with it. the link above has a link to a blog that explains how to set up for debugging.