It's all about the answers!

Ask a question

Create FollowUp WorkItem based on boolean value selection


Sachin Nairy (5111119) | asked Apr 03 '13, 8:02 a.m.

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

Accepted answer


permanent link
Ralph Schoon (59.4k23642) | answered Apr 03 '13, 9:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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

One other answer



permanent link
Eric Jodet (6.3k5109120) | answered Apr 03 '13, 8:43 a.m.
JAZZ DEVELOPER
 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.

Your answer


Register or to post your answer.