It's all about the answers!

Ask a question

Automatically set owner in actions?

Henrik Jönsson (1537) | asked Jun 30 '14, 6:46 a.m.
 Is it possible somehow to automatically set the owner of a work item when doing a workflow transition?

I'm building a helpdesk database with RTC and work items. The roles are Analysers and Customers. I have states for analysing work items and a state for requesting more info from the customer. 
The process is like this:
1. The customer creates the work item
2. A manager assigns the work item for analysing to a specific analyser.
3. The analyser checks the work item and realise he needs more info from the customer. 
4. The customer adds the missing info and return it to the analyser.

In step 3 and 4 I don't want the users to scroll a big listbox in order to find the correct user (Customer or Analyser). The information is already in the work item, so I would like to programatically set the analyser or customer when doing the transitions.

Is this possible?

One answer

permanent link
Eric Jodet (6.3k5111120) | answered Jun 30 '14, 7:11 a.m.
 Hello Henrik,
I would create 2 attributes that will not be presented (hidden) - customer and analyzer
creation: customer attribute is set based on creator id
assign: set analyzer attribute based on selected value.
I would use a value set provider to set these values.

I suspect that based on status - investigating or need more info - you want to set the "owner" of the work item
(the person in charge of the next / pending action).

I would use a calculated value set provider -
and set owner based on workflow status.
if status = need more info
return owner is customer attribute id
return analyzer id.

Let me know if the above makes sense,
or if more details needed.


Henrik Jönsson commented Jun 30 '14, 7:21 a.m.

Thanks! I will try this out and let you know the results.

Ralph Schoon commented Jun 30 '14, 7:41 a.m.

The problem with calculated value providers for the owner attribute is, that it always needs to calculate. That is why we suggest to make calculated attributes read only. In addition the attribute customization is always for all work item types. So you can't easily limit them to just a special type.

If you want to go this way, it might be a good idea to do this not with the owner attribute, but with a custom attribute.

Another approach you could try is Java Work Item save participants (example: The benefit is, that it would run on the server can be much more selective as well as has access to user and role data.

Henrik Jönsson commented Jun 30 '14, 8:07 a.m.

Thanks for the info. I'll keep this in mind. Developing a server based participant is more difficult. Especially the deployment part as I'm not the admin of our server. 

Chris Ball commented Jul 30 '14, 8:10 a.m.

I have done this successfully with a server side extension as Ralph has suggested (Based on his create work item approval example).

I created a server side extension called "update owner on state change" to which we pass the work item state we want to update on and the name of the attribute containing the user who should take ownership.

Your answer

Register or to post your answer.