It's all about the answers!

Ask a question

Reset Owned By based on WI status

Jeremy Upright (2145) | asked Mar 27 '14, 3:13 p.m.
I would like for my RTC WI to require the Owned By field be re-populated when the state changes.  Is there a way to set Owned By to <unassigned> or null and require that a new value be added before saving?

Example scenario would be a defect has been resolved by John Doe, and now need to be assigned to Sally Smith to be retested.  When the defect manager changes the state from Resolved to Ready for Test, RTC should prompt for a new owner.

Is this possible within the process configuration or would if be handled via script?  Any samples of similar requests?

One answer

permanent link
Millard Ellingsworth (2.5k12431) | answered Mar 27 '14, 7:01 p.m.
I'll start by borrowing some comments from @gmclemm on a similar question: Are you sure you want to do this? Fixing the defect and verifying the fix are different activities, clearly in your case carried out by different people. Might it be better to use an Approval to track the testing (so the defect manager could create an approval and assign it to a tester)? Or use a child or related work item for the testing activity (allows you to track time and have independent discussion)? If the verification is not successful, how do you know who to return it to if you changed the owner? It would be easier to change the status to Re-opened and have it show back up in that person's queue than search the work item's history to see who the previous owner was.

All that said, here is an example using a JavaScript customization that sets the owner to a particular value when the work item is in a particular state:  

HOWEVER, I'm not sure this sort of thing will work as you expect. Catching state changes can be difficult and your calculated value provider needs to behave the same way on both the client and server. You won't know that it went from State A to State B, you'll just know that the state changed and it is now State B (so you could be coming from State C to State B). If your customization clears the OwnedBy field (as opposed to reassigning it), you'll either end up getting it saved without an owner (not what you want) or it will fail to save if Owner is a required attribute.

A lot more details here if you decide to head down this path:

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.