How to set iteration type value use plain java api
My environment is 7.0.1 ifix9
I have a custom attribute,type is iteration
this is my code
IAttribute attribute = workItemClient.findAttribute(workItem.getProjectArea(), "custom_attr_id", monitor);
System.out.println("debug1>>"+iAttribute.getAttributeType());
IEnumeration<? extends ILiteral> enums = workItemClient.resolveEnumeration(iAttribute, monitor);
for (ILiteral literal : enums.getEnumerationLiterals()) {
System.out.println("debug2>>"+literal.getName());
}
but always throw an exception
org.eclipse.core.runtime.AssertionFailedException: assertion failed: Expected enumeration or enumeration List, actual attributeType - interval type - interval
what is interval type?? and how can i set value if select a dropdown value?
Accepted answer
An iteration is NOT an enumeration. See https://rsjazz.wordpress.com/2012/10/05/handling-iterations-automation-for-the-planned-for-attribute/ for how to work with timelines and iterations in the Java API.
Comments
Hi Ralph
Thanks your answer .
My Main Development list:
Release 1.0 (current)
---0.ProjectRequirement (current)
---1.ProjectDesign
Backlog
My code
IDevelopmentLineHandle developmentLineHandle = projectArea.getProjectDevelopmentLine();
IDevelopmentLine developmentLine = auditableClient.resolveAuditable(developmentLineHandle,ItemProfile.DEVELOPMENT_LINE_DEFAULT, monitor);
List<IIteration> lines = auditableClient.findCurrentIterations(developmentLine, monitor);
for(IIteration iit:lines){
System.out.println(iit.getName());
}
return :
Release 1.0
0.ProjectA-Requirement
How to get Backlog or other childs?
I think there is code on my blog that allows to find timelines by their name and also shows how to iterate the iteration hierarchy.
The purpose of my blog article was to provide readers an example so I do not have to answer this over and over here.
Comments
faith chen
Jul 19 '21, 2:48 a.m.reference