It's all about the answers!

Ask a question

Approvals and workitem state change

viswanath janakiraman (81123) | asked Nov 15 '12, 6:33 a.m.
When the Code approver/Test approver approves it should automatically updates the Workitem state as code approved/test approved and also once verfication is done then the work item get completed .

One answer

permanent link
Lauren Hayward Schaefer (3.3k11427) | answered Nov 15 '12, 7:16 a.m.
You can use Approval Trackings to automatically trigger changes based on approvals. has a little more information about this.

Dan Sevcenco commented May 06 '13, 7:47 a.m.

Hello Lauren,

How does one do this workflow state change via plugin code on server side? The solution you suggested does not work for me because it interferes with and advisor that acts as guard against state change unless certain conditions are met.

So, as far as I know about RTC (and I will admit to having limited knowledge as I have started on the RTC extending path only a couple of weeks ago) I need to manage this in a participant that invokes :

fWorkItemServer.saveWorkItem2 (workItemWorkingCopy, null, workflowAction);

where workflowAction is the ID of a workflow target state.

Unfortunaltely, this does not produce any results in my case. By the way, I am working with RTC v4.0.0


Lauren Hayward Schaefer commented May 06 '13, 8:39 a.m.

Hi Dan,

There are "Approval Trackings" that will automatically change the state of a work item based on an approval changing. has a good screenshot of Approval Trackings. explains how to set them up.  An example is "In the Defect Workflow in the Scrum process, when a user sets the Verification approval to Approved, the Verify workflow action is performed. That action changes the state of the work item from Resolved to Verified."

Dan Sevcenco commented May 06 '13, 9:21 a.m.


Thanks for the info but that is exactly what I cannot do because RTC managed automatic workflow state transitions interfere with my advisor and participant.

So I have to trigger the state change myself and it does not work with the saveWorkItem2 method. There is something that I am missing but what?

Can you please post a very simple example of server side code that does that and you know works? I want to see if my code is missing some required code.

Thank you.


Lauren Hayward Schaefer commented May 06 '13, 9:33 a.m.

Hi Dan,

I misunderstood your first comment. has example code that updates the state of a work item.

Dan Sevcenco commented May 07 '13, 3:01 a.m.

Hello Lauren,

That is exactly the example I have been looking at for the past 2 days in order to understand the differences between that code and mine. Except for the fact that I am invoking the saveWorkItem2 versus saveWorkItem3 in that example, there is no difference in the way the save is set up.

So, why is saveWorkItem2 not working????

Lauren Hayward Schaefer commented May 07 '13, 6:54 a.m.

Hi Dan,

I'm not very familiar with this part of the api myself, so I'm not sure what the difference is.  @rschoon can you shed some light on this?

showing 5 of 6 show 1 more comments

Your answer

Register or to post your answer.