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

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?

0 votes


Accepted answer

Permanent link

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.

Ralph Schoon selected this answer as the correct answer

0 votes

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.

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,951
× 7,506
× 1,336

Question asked: Jul 19 '21, 2:47 a.m.

Question was seen: 406 times

Last updated: Jul 19 '21, 4:54 a.m.

Confirmation Cancel Confirm