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 |
6 answers
bliq158 wrote:
I have problem with setting plannedFor attribute for example on Hi You are probably looking for com.ibm.team.workitem.common.model.IWorkItem.setTarget(IIterationHandle) -- Cheers, Johannes Agile Planning Team |
|
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 |
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? |
IDevelopmentLine iDevelopmentLine = 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 |
|
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.