How do I trigger a workitem (task in this case) to be automatically created based on a change in state for a Defect workitem
2 answers
Steve,
if you want to develop this you need a server side extension against the RTC Java API. Basics are shown in the freely available Extension workshop on jazz.net : https://jazz.net/library/article/1000
My company Method Park actually wrote a generic plugin for this to be configured from modelled process. So this is commercially available or you would have to write your own.
- Arne
Comments
1 vote
Steve,
I've done such an automation several times.
Here are some code snippets (using server-side Java API) that could help you.
// create a workitem
IWorkItemServer workItemServer = ....;
IWorkItemType workItemTargetType = ......;
IWorkItem workItemTarget = null;
workItemTarget = workItemServer.createWorkItem2(workItemTargetType);
// set the attributes
IAttribute attribute = ....;
Object attributeValue = ...;
workItemTarget.setValue(attribute, attributeValue);
// create link with parent workitem ("sourceWorkItem")
IWorkItem sourceWorkItem = ...;
references = workItemServer.resolveWorkItemReferences(workItemTarget, null);
references.add(WorkItemEndPoints.PARENT_WORK_ITEM, WorkItemLinkTypes.createWorkItemReference(sourceWorkItem));
// save the workitem
workItemServer.saveWorkItem2(workItemTarget, references, null);