Welcome to the Jazz Community Forum
how to set owned by in attribute customization?

How to set owned by value same the person modifying the status of the defect =Resolved?
Currently the example customization need to identify the id of the owner , but i wanted it dependent on who is currenly changing the defect status, no predefined value. Is this possible? I tried this but didnt work
dojo.provide("com.acme.providers.script.OwnedByAutoAssign");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var scriptname = "OwnedByAutoAssign";
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
var OwnedByAutoAssign= dojo.declare("org.example.OwnedByAutoAssign", null, {
getValue: function(attributeId, workItem, configuration) {
if (workItem.getValue(WorkItemAttributes.TYPE) === "defect" && workItem.getValue(WorkItemAttributes.STATE) === "3") {
return workItem.getValue(WorkItemAttributes.MODIFIED_BY);
} else {
return workItem.getValue(WorkItemAttributes.OWNER);
}
}
});
})();