It's all about the answers!

Ask a question

Changing Workflow of a Type and preserving or mapping Status


Chris Zardis (6134) | asked Oct 02 '11, 4:40 p.m.
Hi,

I wish to move a work item type to a new workflow.

This is easily done, but there are a large number of work items and I would like to preserve their statuses (e.g. "In Progress"), either automatically or by somehow mapping the old workflow's statuses to the statuses of the new workflow.

Having looked at the process configuration, the IDs of the statuses of the new work flow are different to those of the old workflow (despite the fact that I have based the new workflow on the old one and preserved all of the existing statuses).

When testing with a small number of work items, the statuses of the work items are not preserved, and end up in 'uninitialized' state.

I would like to preserve (or map) the statuses of the work items when I switch the workflow. Has anyone had any success in doing this?

Many Thanks,
Chris

One answer



permanent link
Chris Zardis (6134) | answered Oct 04 '11, 10:30 a.m.
The issue is that all workflow have unique IDs for all of their states. A work item using the default workflow in 'In Progress' status may well have a status ID of 's2', but as 'In Progress' in the new workflow has (for example) an ID of 'newworkflow.s2' the state will show 'Uninitialized' (i.e. 'invalid') if you were just to switch it over. In order to display a valid status, the status ID of the work item must exist in the new workflow.

The work around I have found is to use the Process Configuration Source to copy all of the states of the old workflow to the new workflow, to rename their names to (for example) 'In ProgressOLD' and to give them an action from the new workflow (which will allow us to move them to the appropriate state in the new workflow). You should also copy the old resolutions over to the new workflow, although this is mainly to keep the work items in a valid state until you move them to new statuses / resolutions. Some of the old statuses may lack exact matches to the new ones - use common sense as to what state would be appropriate to put them in (and thus which action should be provided for that state).

An excerpt of an example is shown below, with the additions to the new workflow in bold. Make sure you back up the original Process Configuration Source before making any changes live! I also recommend using a 'diff compare tool' to verify any changes you make - I don't know what the implications of getting this wrong are but I am assuming they are not good.

<workflow name="New Workflow" resolveActionId="newworkflow.action.a2" startActionId="newworkflow.action.a5">
<resolution icon="processattachment:/workflow/duplicate.gif" id="newworkflow.resolution.r1" name="Duplicate"/>
<resolution icon="processattachment:/workflow/close.gif" id="newworkflow.resolution.r4" name="Fixed"/>
...
<resolution icon="processattachment:/workflow/duplicate.gif" id="oldworkflow.resolution.r1" name="DuplicateOLD"/>
<resolution icon="processattachment:/workflow/close.gif" id="oldworkflow.resolution.r9" name="FixedOLD"/>
<resolution icon="processattachment:/workflow/close.gif" id="oldworkflow.resolution.r10" name="ClosedOLD"/>

...
<action icon="processattachment:/workflow/inprogress.gif" id="newworkflow.action.a4" name="Start Working" state="newworkflow.state.s4"/>
...
<state group="inprogress" icon="processattachment:/workflow/inprogress.gif" id="newworkflow.state.s4" name="In Progress" showResolution="false">
<action id="newworkflow.action.a7"/>
<action id="newworkflow.action.a8"/>
<action id="newworkflow.action.a9"/>
</state>
...
<state group="inprogress" icon="processattachment:/workflow/inprogress.gif" id="oldworkflow.state.s4" name="In ProgressOLD" showResolution="false">
<action id="newworkflow.action.a4"/>
</state>


After editing the Process Configuration Source (double check and check again), you are now ready to move the work item type over to the new workflow. All of the work items that were 'In Progress' in the old workflow will now be 'In ProgressOLD' in the new workflow.

There is now the task of going through and editing the statuses of the work items so that they go from, for example, 'In ProgressOLD' to 'In Progress' (a valid state in the new workflow). It is easiest to do this en-mass. After you are finished, perform a 'Synchronize attributes' on the work items (right click the 'Type' icon to see this action).

Once all of this is done and you have checked that everything is in a valid state, it is safe to go back and remove the additions to the process configuration source.

If anyone has identified another way of doing this I'd be interested. Please be careful and ensure you are familiar with all of the relevant areas of RTC beforehand if you chose to embark upon this yourself. I would also recommend testing this on a test Project Area before rolling it out on a live server.

Your answer


Register or 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.