It's all about the answers!

Ask a question

how to get the old references of a workitem?


Surender Biyyala (401948) | asked Nov 13 '14, 2:32 a.m.
 Hi All,

I`m Trying to develop a plugin where I need to auto calculate a field based on the its children.
It worked fine for me in all the scenarios but facing issue as below.

When I edited the children to remove the parent work item I`m not able to get the Parent workitemhandle to update it accordingly.

Can any one help me out in getting this done.

I tried getting the parent workitemhandle but it is returning null and I did not find any method to get the old references.

Thanks
Surender

Accepted answer


permanent link
Ralph Schoon (58.2k23642) | answered Nov 13 '14, 2:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I'd try to get the references of the old state and the current references and compare the list.
Surender Biyyala selected this answer as the correct answer

Comments
Surender Biyyala commented Nov 13 '14, 3:41 a.m.

Thanks Ralph.


 i got the old state and I did not find any methods to get the references.
could you please point me to some example source.

saveParameter.getNewReferences().getReferences(WorkItemEndPoints.PARENT_WORK_ITEM)

This is what I`m using now to get the parent workitem.

Thanks
Surender.


Ralph Schoon commented Nov 13 '14, 3:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I would try to resolve the old state and then use the normal API to get the references from that. There should be example code in my blog that you could find searching for "References". There might be something here: http://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/

Your answer


Register or to post your answer.