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
Accepted answer
Thanks Eric!
To create a work item in a participant you can use code similar to
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
to save the work item that needs the references added.
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.
One other answer
Hello,
I would start with the extension workshop https://jazz.net/library/article/1000
then read Ralph's blog - http://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/
and create a save participant that will check on the values of the booleans.
Hope it helps.
Eric.