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

Create FollowUp WorkItem based on boolean value selection

Hi,

I have a requirement to create multiple chilled work item automatically for a task based on selecting Boolean value.

Ex : if i select 2 Boolean value like review & build  for a task, 2 chilled task should be add to that task automatically with some pre define values.

 

Please suggest for best way to do this.

Thanks & Regards

Sachin Nairy

0 votes


Accepted answer

Permanent link
Thanks Eric!

To create a work item in a participant you can use code similar to
		// Create the work item
		IWorkItem newTargetWorkItem = fWorkItemServer
				.createWorkItem2(targetWorkItemType);

		// Set the summary
		XMLString targetSummary = triggerWorkItem.getHTMLSummary();
		XMLString addition = XMLString.createFromPlainText(" [ "
		/* + targetEnumerationAttribute.getDisplayName() + " " */
		+ targetEnumerationLiteral.getName() + " ]");
		XMLString newSummary = targetSummary.concat(addition);
		newTargetWorkItem.setHTMLSummary(XMLString.createFromXMLText(newSummary
				.getXMLText()));
		
		// Set the category same as the parent.
		ICategoryHandle category = triggerWorkItem.getCategory();
		if (category != null) {
			newTargetWorkItem.setCategory(triggerWorkItem.getCategory());
		}

		// Set Planned for same as the parent
		IIterationHandle iteration = triggerWorkItem.getTarget();
		if (iteration != null) {
			newTargetWorkItem.setTarget(iteration);
		}
		

		IStatus status = fWorkItemServer.saveWorkItem3(newTargetWorkItem, null, null,
				null);
		if(status.isOK())
			// we are good

Then follow http://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/ how to create links to work items. With the references created and added to newWorkItemReferences use
		// Save the trigger work item with the links we created
		IStatus saveStatus = fWorkItemServer.saveWorkItem3(Item,
				newWorkItemReferences, null, null);

to save the work item that needs the references added.
Sachin Nairy selected this answer as the correct answer

0 votes


One other answer

Permanent link
 Hello,
I would start with the extension workshop https://jazz.net/library/article/1000
and create a save participant that will check on the values of the booleans.

Hope it helps.
Eric.

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

Question asked: Apr 03 '13, 8:02 a.m.

Question was seen: 4,089 times

Last updated: Apr 03 '13, 9:03 a.m.

Confirmation Cancel Confirm