Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to fetch changeset information on workitem save?

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.

0 votes



One answer

Permanent link
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.

0 votes

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... ?


showing 5 of 6 show 1 more comments

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,941

Question asked: Apr 10 '15, 6:23 a.m.

Question was seen: 3,486 times

Last updated: Jul 05 '15, 2:38 p.m.

Confirmation Cancel Confirm