It's all about the answers!

Ask a question

Validate the "Implements Requirement" link in work item in Precondition

Parveen Patel (77125) | asked May 18 '16, 6:52 a.m.

Hi All,

I am trying to validate the Parent and Child work item should have same requirement linked using Java API in precondition.

I am using Implements Requirement link type to link requirement from Doors in both child and parent work item.

Any help is much appreciated.

Thanks in advance.

Accepted answer

permanent link
sam detweiler (12.5k6194201) | answered May 18 '16, 7:36 a.m.
edited May 18 '16, 7:36 a.m.
here is a link to my custom precondition to enforce Depends On , the second post

you should be able to tell if the workitem is the parent or child be the parent/child link

and then see if it has the implements link you are interested in.
you should be able to see both workitems at the same time (after following the link)..

but I have a question..
how can BOTH workitems 'Implement' the requirement?  this is not logical to me.. if one does, then the other cannot.
Parveen Patel selected this answer as the correct answer

Parveen Patel commented May 18 '16, 7:57 a.m.

Hi Sam,

I am able to detect that the Parent and Child have implements link. but I want to validate the requirement link in both the work items should be same.

How can achieve this using java api.

sam detweiler commented May 18 '16, 8:00 a.m.

you have to get the object on the end of the link and compare the two.

my code here

has a set of methods to look thru all the links..

analyzeItem() is the one you want to look at for getting the item on theĀ  end of the link

Your answer

Register or to post your answer.