It's all about the answers!

Ask a question

How do we know whether an workitem has links programmatically


Girish Chandra (852943) | asked Jun 18 '15, 5:10 a.m.
edited Jun 18 '15, 5:13 a.m. by Ralph Schoon (59.4k23642)
I need to count the number of links for a given work item.
Scenario: I can save a work item or promote work item for next state only when we have child items to the Parent.
Kindly let me know how can I achieve the same.

One answer



permanent link
Ralph Schoon (59.4k23642) | answered Jun 18 '15, 5:15 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 Please see https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/ especially Accessing References.

Comments
Ralph Schoon commented Jun 18 '15, 5:18 a.m. | edited Jun 18 '15, 5:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 You need to write a work item save advisor. The closest example I have published is https://rsjazz.wordpress.com/2014/05/26/only-owner-can-close-workitem-advisor/


Also see the extensions workshop referenced in the post to detect a state change.

You also want to look at the server link API: https://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/

Basically you want to check if there are children similar to https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ and then decide to stop the save. 


Your answer


Register or to post your answer.