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

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

0 votes



4 answers

Permanent link
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

0 votes


Permanent link
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?

Thanks,

Dave

0 votes


Permanent link
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

0 votes


Permanent link
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...

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

Question asked: Feb 19 '09, 5:08 p.m.

Question was seen: 6,556 times

Last updated: Jul 11 '14, 12:01 p.m.

Confirmation Cancel Confirm