It's all about the answers!

Ask a question

How to get a Work Items Link in a custom preconditon?


Jorge Valdeiglesias (541823) | asked Sep 02 '14, 12:09 p.m.
I'm developing a custom precondition that checks if the work item has certain links (live resolves) before resolving it.

I've set the development enviroment and did the workshop but I can't find a way to get the links for a work item and check the precondition.

Anyone knows how to do it?

Accepted answer


permanent link
sam detweiler (12.5k6186201) | answered Sep 03 '14, 7:28 a.m.
here is the source of an advisor I wrote to check for a depends on link, and prevent the workitem resolving if the workitem depended on is not resolved.

https://jazz.net/forum/questions/64268/operation-advisor-custom-precondition-for-work-items

second post
Jorge Valdeiglesias selected this answer as the correct answer

Comments
Jorge Valdeiglesias commented Sep 03 '14, 8:18 a.m. | edited Sep 03 '14, 8:19 a.m.

Thanks for the help!


I've end up using this: 

List references = saveParameter.getNewReferences().getReferences(WorkItemEndPoints.RESOLVES_WORK_ITEM);

Worked like a charm. Now I will try to make the link type configurable.

One other answer



permanent link
Kevin Eifinger (1211510) | answered Sep 03 '14, 3:40 a.m.
 Hi Jorge,
have a look at 

https://jazz.net/forum/questions/161758/how-to-retrieve-the-changesets-associated-to-a-workitem-via-java-api

where Olivier explained how to receive Changesets associated with a Work Item.

If you run through the Workshop your development environment should be set up correctly. In your Eclipse do a "Java Search" and search for "WorkItemLinkTypes" (Types,References,..,Workspace).

With both information you should be able to solve your problem.

Have fun programming RTC extensions!

Your answer


Register or to post your answer.