How to show default resolution upon workitem submission?
We are using RTC 502 and have "Defect" workitem states "Draft"<== "Analysis" ==> "Implementation" ==> "Integration" ==> "Validation" ==> "Done".
The process template is enabled to show resolution "Duplicate" / "Reject" / "Fixed" values in the following states "Implementation" ==> "Integration" ==> "Validation" ==> "Done".
Now the customer wants to make it uniform and show "None" in "Draft" and "Analysis" state. Along with that, upon Defect submission, they want to show "None". So that the other person can see the resolution as "None" in "Analysis" and "Draft" by default (not selectable by user).
When I move the defect from "Analysis" ==> "Draft", it is showing "None" without any issue. But when I submit a new defect, the "Resolution" field is always "blank", though I "enabled" to show "Resolution" in all these three actions.
What could be the issue?
3 answers
the resolution is not initialized to None when a workitem is created. it is only set on the state changes where resolution would be used
Comments
Once it is submitted, it will be in "Analyze" state and the resolution should be visible in this state which is nothing but "None". Why it is not happening?
Once it is submitted, it will be in "Analyze" state and the resolution should be visible in this state which is nothing but "None". Why it is not happening?
is 'Analyze' in a closed state group? If not, resolution does not apply.
'Analyze" is in Open state group. But we have option to select "Resolution' in "Initialize" action. And the same can be displayed in "Analysis" state using "Show resolution". Both are selected.
FYI: when we move the defect from "Analysis" to "Draft" state using "Set Draft" action, we are able to see "None" and upon save and after save we are able to see "None" in "resolution field" Here "Draft" is also configured in "Open" state group.
Finally I found a solution using "dojo"script. Inside "Attribute Customization" under "Calculated Values", I have added the below script. Then this "calculated value" is selected in "Resolution" field of the "Defect" workitem. Now it is working fine.
dojo.provide("com.visteon.workitem.resolutionrestore");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
debug=true;
console.log("im here");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.visteon.workitem.resolutionrestore", null, {
getValue: function(attributeId, workItem, configuration)
{
var workitemstate = workItem.getLabel(WorkItemAttributes.STATE);
var Resolution_Val= workItem.getValue(WorkItemAttributes.RESOLUTION);
// console.log("worktem state is " + workitemstate);
// console.log("worktem Resolution_Val is " + Resolution_Val);
var type= workItem.getValue(WorkItemAttributes.TYPE);
if(type == "defect")
{
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
debug=true;
console.log("im here");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.visteon.workitem.resolutionrestore", null, {
getValue: function(attributeId, workItem, configuration)
{
var workitemstate = workItem.getLabel(WorkItemAttributes.STATE);
var Resolution_Val= workItem.getValue(WorkItemAttributes.RESOLUTION);
// console.log("worktem state is " + workitemstate);
// console.log("worktem Resolution_Val is " + Resolution_Val);
var type= workItem.getValue(WorkItemAttributes.TYPE);
if(type == "defect")
{
if((workitemstate == ""))
{
Resolution_Val = "0";
}
return Resolution_Val;
}
}
});
})();
{
Resolution_Val = "0";
}
return Resolution_Val;
}
}
});
})();