It's all about the answers!

Ask a question

How to edit work items from a participant

Paul B (21313) | asked Sep 08 '15, 2:22 a.m.
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))

ISaveParameter saveParameter= (ISaveParameter) data;
if (!(saveParameter.getNewState() instanceof IWorkItem))
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>();


One answer

permanent link
Ralph Schoon (63.2k33646) | answered Sep 10 '15, 4:02 a.m.
edited Sep 10 '15, 4:04 a.m.
See 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.

Your answer

Register or 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.