It's all about the answers!

Ask a question

Displaying work item resolution on closed work items

frank malin (3277) | asked Mar 22 '13, 3:49 p.m.
I've changed the defect workflow state of "resolved" into two states:
"resolved" with a resolution of "fixed" or "duplicate"
"returned" with a resolution of "more information" or "not recreateable"

and I've also added a "closed" state.

In the case of "returned" and "not recreateable", the originator of the work item would "accept answer", and the work item would transfer to "closed" state.

I would like to keep the "resolution" on the closed work item. But when "accept answer" action is selected, the resolutions disappears.

I can get it to work, by checking "show resolution" on the "Closed" state. However, it does allow the user to edit the "resolution" and possibly change the value when the "accept answer" action is selected. Is there some why which the resolution can be displayed and not allow the user to change the value?

I've tried to see if I could make the value "resolution" as read only, on certain states. But it seem that resolution is a special variable, and does not allow setting.

From what I can tell of the behavior, it seems the resolution attribute is assumed to be transient data associated with a certain state, and not persistent data associated with the work item.

Bin Yang commented Jan 20 '14, 11:06 a.m. | edited Jan 15 '16, 2:37 a.m.

I am having the same problem.

What I am doing now is to create a Resolution custom field, and make it only show up at Resolved and Closed states.

I wonder if anyone has a better solution.

2 answers

permanent link
sam detweiler (12.5k6185201) | answered Mar 22 '13, 4:04 p.m.
edited Mar 22 '13, 4:06 p.m.
with the out of the box solutions, if you have multiple resolutions for a state, you cannot prevent it being changed.

you could write a participant that forces it to stay as previously selected, altho that might be weird for the user, who set it to another value, and it didn't stay set that way.

or you can trigger an error in an advisor, that says, sorry, you can't change the value on this action.

permanent link
vikrant kamble (1321185) | answered Jan 15 '16, 1:57 a.m.
edited Jan 15 '16, 2:25 a.m.
 Hi All,
I also have same scenario but for custom work item,
I have two sates for work item,
"Resolved" and "Pending Validation"
For resolved work item there are 5 resolutions, one of them is "Feature Implemented", when work item traverse from Resolved state to Pending Validation state, resolution of Pending Validation state should be "Feature Implemented".
Pending validation state has 3 resolutions, which allows user to select any of them and save work item.
To achieve this I also searched to make resolution of work item read only, but I also faced same problems as Frank faced.
Therefore to achieve this requirement, I came up with 2 solutions as below

Solution 1: 
In the process configuration tab of project area-->Project configuration-->Configuration Data-->Work items-->Workflow,
I can set only one resolution for Pending Validation state i.e. Feature Implemented.
Solution 2:
I can customize attribute for 
Script based validator, which shall save work item when resolution of Pending Validation state is "Feature Implemented".
This way when work item traverse from Resolved state to Pending Validation state, default resolution for Pending Validation states shall be "Feature Implemented", and work item shall not be saved if resolution for Pending Validation state is changed to other than "Feature Implemented".

Here is script for validator, which restrict resolution of work item to be duplicate when in resolve state. This script is for defect work item.



(function() {
var Severity=;
var Status=;
var WorkItemAttributes=;

var RestrictResolutionState= dojo.declare("org.example.RestrictResolutionState", null, 

   validate: function(attributeId, workItem, configuration) 

if (workItem.getValue(WorkItemAttributes.TYPE) === "defect" && workItem.getValue(WorkItemAttributes.STATE) === "3") 
if (workItem.getValue(WorkItemAttributes.RESOLUTION) === "2") 
return Status.OK_STATUS;

var severity= configuration.getChild("parameters").getStringDefault("severity",;

var message= configuration.getChild("parameters").getStringDefault("message", "");

return new Status(Severity[severity], message);
} else {
return Status.OK_STATUS;

Note : <parameters message="Resolution of WI should be Duplicate." severity="ERROR"/>, Add this line above closing tag of validator, in process configuration source tab.

Please tell me if this is valid answer, or if anyone having better solution.

Donald Nong commented Jan 17 '16, 7:13 p.m.

Thank you for sharing the solution. But only you can decide whether the other solutions are "better". If the current solution works for you, that's good enough.

Your answer

Register or to post your answer.