How to change plannedFor attribute programmatically?
6 answers
bliq158 wrote:
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
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
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?
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?
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