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

[closed] 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


The question has been closed for the following reason: "Duplicate Question" by rschoon Sep 10 '15, 4:06 a.m.

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

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

Question was seen: 1,972 times

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

Confirmation Cancel Confirm