It's all about the answers!

Ask a question

How to fetch changeset information on workitem save?


Vikash Singh (42665) | asked Apr 10 '15, 6:23 a.m.
I am writing an advisor to get the change set information from link section of Task.

What is the workitem end point to get changeSet link or How to get reference to changeSet?

for example
I used below code to get related work items
List<IReference> links = param.getNewReferences().getReferences(WorkItemEndPoints.RELATED_WORK_ITEM);

Note:- I am writing a precondition using server side APIs.

One answer



permanent link
Ralph Schoon (56.3k23642) | answered Apr 10 '15, 6:49 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Apr 10 '15, 6:50 a.m.
The link type is  WorkItemLinkTypes.CHANGE_SET , I think.

https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/ explains the other direction. Maybe that helps.

Comments
Vikash Singh commented Apr 24 '15, 7:49 a.m.

Thank you for your reply. I am writing advisor which trigers on workitem save and the extension point used is"com.ibm.team.process.service.operationAdvisors"(com.ibm.team.workitem.operation.workItemSave).

How can I access changeset attached to workitem using code on Workitem save.


sam detweiler commented Apr 24 '15, 8:36 a.m.

the linktype Ralph mentioned will get you to the changeset object.
and his blog post will show you code examples for accessing a changeset from an advisor (aka pre-condition)



Vikash Singh commented Apr 28 '15, 6:15 a.m.

Hi Sam,

Ralph mentioned advisor would trigger on delivery of a change set however my requirement is at the time of save workitem.

for Example-

Object data = operation.getOperationData();

ISaveParameter param = (ISaveParameter) data;

Thank you.


Ralph Schoon commented Apr 28 '15, 6:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The blog shows other operational behavior that triggers on a work item save. Search for Advisor or Participant in the search field in the right upper section.

Similar to the deliver operation you get the operation data - in this case a work item and then you can look at its data and linked data as well and do something.


sam detweiler commented Apr 28 '15, 7:59 a.m.

right.. the changeset link is in the workitem links.. so you should be able to get that is the advisor without problem.


Chandan M B commented Jul 01 '15, 6:35 a.m. | edited Jul 05 '15, 2:38 p.m.

Hi Vikash,

Any updates... ?


showing 5 of 6 show 1 more comments

Your answer


Register or to post your answer.