How to fetch changeset information on workitem save?
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
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
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.
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)
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.
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.
right.. the changeset link is in the workitem links.. so you should be able to get that is the advisor without problem.
Hi Vikash,
Any updates... ?