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

How to edit work items from a participant

Hi everyone,

I've recently got a working participant up and running and have been experimenting with different interfaces to see what's available. What I'm trying to do is when the save button is hit, I want to add some text to the comment field and add a couple of tags to the tags field.

Below is a snippet (cause i can't upload pictures yet) of the code I have thus far. I've been trying different things so this isn't the only code I've tried. If someone could correct what I'm doing wrong that would be great.

public void run(AdvisableOperation operation,
IProcessConfigurationElement participantConfig,
IParticipantInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException {
System.out.println("FYI - Plugin reached");
Object data= operation.getOperationData();
if (!(data instanceof ISaveParameter))
return;

ISaveParameter saveParameter= (ISaveParameter) data;
if (!(saveParameter.getNewState() instanceof IWorkItem))
return;
IAuditable auditable = saveParameter.getNewState();

if (auditable instanceof IWorkItem) {
IWorkItem workItem = (IWorkItem) auditable;
IWorkItem workItem2 = (IWorkItem) workItem.getWorkingCopy();

System.out.println("FYI - Section 2 reached");
workItem2.setHTMLDescription(XMLString.createFromPlainText("This is a test to see if it works"));
List<String> tags = new LinkedList<String>();
tags.add("Paul");
tags.add("House");
workItem2.setTags2(tags);
}

Thanks

0 votes



One answer

Permanent link
See https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ and be aware that the save is a new save and WILL trigger the participant again, which will result in a recursive descent death of the save and or the server if you don't prevent that from happening as described in the blog post above.

0 votes

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,938

Question asked: Sep 08 '15, 2:22 a.m.

Question was seen: 2,330 times

Last updated: Sep 10 '15, 4:04 a.m.

Confirmation Cancel Confirm