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

How to change plannedFor attribute programmatically?

I have problem with setting plannedFor attribute for example on "aaa".
I know that I need IIterationHandle but how to set it?

Thanks

0 votes



6 answers

Permanent link
bliq158 wrote:
I have problem with setting plannedFor attribute for example on
"aaa".
I know that I need IIterationHandle but how to set it?

Hi

You are probably looking for
com.ibm.team.workitem.common.model.IWorkItem.setTarget(IIterationHandle)


--
Cheers, Johannes
Agile Planning Team

0 votes


Permanent link
But from where can I get IIterationHandle?

0 votes


Permanent link
bliq158 wrote:
But from where can I get IIterationHandle?


A general entry point would be

com.ibm.team.process.common.IProjectArea.getDevelopmentLines()

It will give you all development lines for a given project area. From a
development line you can get (child-)iterations.

--
Cheers, Johannes
Agile Planning Team

0 votes


Permanent link
I tried something like that:

IIterationHandle iteration = null;
IDevelopmentLineHandle[] iDevelopmentLineHandle = projectArea.getDevelopmentLines();

//I know that iDevelopmentLine.length =0
for(int i = 0; i < iDevelopmentLineHandle.length;i++)
{
IDevelopmentLine iDevelopmentLine = (IDevelopmentLine)iDevelopmentLineHandle;
iteration= iDevelopmentLine.getCurrentIteration();
}

IAttribute plannedFor= workItemClient.findAttribute(project,IWorkItem.TARGET_PROPERTY, monitor);

workItem.setValue(plannedFor, iteration);



I get:
java.lang.ClassCastException: com.ibm.team.process.internal.common.impl.DevelopmentLineHandleImpl incompatible with com.ibm.team.process.common.IDevelopmentLine


What did I do wrong?

0 votes


Permanent link
IDevelopmentLine iDevelopmentLine =
(IDevelopmentLine)iDevelopmentLineHandle;

You can't cast an IDevelopmentLineHandle to an IDevelopmentLine, you have
to resolve the handle to get the IDevelopmentLine.

For that, you can either use
IAuditableCommon#resolveAuditable(handle, profile, monitor)
or
IItemManager#fetch*Item(...)

--
Regards,
Patrick
Jazz Work Item Team

0 votes


Permanent link
Thank you, for all your help :)

0 votes

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,937

Question asked: Nov 25 '08, 3:26 a.m.

Question was seen: 7,931 times

Last updated: Nov 25 '08, 3:26 a.m.

Confirmation Cancel Confirm