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

How do I trigger a workitem (task in this case) to be automatically created based on a change in state for a Defect workitem

When managing defects I would like to have CCM automatically create a task based on state/status changes of a defect workitem. Looking for any information to help develop this.

1 vote



2 answers

Permanent link

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

1 vote

Comments

In addition to Arnes answer https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ provides a bit more information and see my answer to https://jazz.net/forum/questions/246919/how-to-create-child-workitems-automatically-when-parent-is-created for links how to create work items in the server API.

1 vote


Permanent link

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);



0 votes

Comments

The actual work in implementing this is covering all Exceptions, checking mandatory fields, checking for StaleDate before saving ...
If you want this to be productive in a setting with >100 users I can only recommend to figure in a factor of x3 - x5 on the time you actually need for coding the plugin to test and deploy.
If you write more than one plugin against e.g. Work Item Save, order of execution is not guaranteed so you have to make sure the plugins play nice with each other. The extensions workshop covers most of the basics there.

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,936
× 7,494

Question asked: Nov 16 '17, 8:34 a.m.

Question was seen: 3,772 times

Last updated: Nov 17 '17, 5:51 a.m.

Confirmation Cancel Confirm