How can I determine if a workitem parent was set or changed?
In a Follow-up action for 'Work Item Save (server)', how can I determine if the workitem being saved just had its parent set or changed in this save operation?
I see a ISaveParameter::getNewReferences() method where I can find the 'new' parent, but there is no corresponding 'getOldReferences()'.
Is there a technique I can use to get the 'old' parent?
Thanks in advance,
Dave
I see a ISaveParameter::getNewReferences() method where I can find the 'new' parent, but there is no corresponding 'getOldReferences()'.
Is there a technique I can use to get the 'old' parent?
Thanks in advance,
Dave
4 answers
In a Follow-up action for 'Work Item Save (server)', how can I
determine if the workitem being saved just had its parent set or
changed in this save operation?
I see a ISaveParameter::getNewReferences() method where I can find the
'new' parent, but there is no corresponding 'getOldReferences()'.
Is there a technique I can use to get the 'old' parent?
You could try to cast to WorkItemReferences. There are methods to get the
deleted and created references:
WorkItemReferences references= (WorkItemReferences)
saveParameter.getNewReferences();
doSomethingWith(references.getDeletedReferences());
doSomethingElseWith(references.getCreatedReferences());
--
Regards,
Patrick
Jazz Work Item Team
Thanks for the reply. This technique worked.
However, I get 'Discouraged Access' warnings from the compiler making
calls to WorkItemReferences.
Can these methods be added to IWorkItemReferences?
I think that would make sense. Please see
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/72536
--
Regards,
Patrick
Jazz Work Item Team
I needed to use this technique as well and it works for detecting created references, but doesn't appear to work for detected deleted references. Is the strategy described above supposed to work for that case? If so, I may have an implementation issue. If it's not possible, I'd appreciate a heads up so I don't waste too much time trying...