Is exist two attribute that type is owner in one workItem?
In workItem,I set two attribute that type is owner,but another attribute in javascript return null,and I use "workItem.isAttributeSet(attributeId)" ,it return false.Why?Is exist two attribute that type is owner in one workItem?
The is my code in attribute customization:
(two attribute are workItem.owner and a attribute customization that type is owner)
log message print:
LOG:attribueId:AtrDevelopResponsePerson
LOG:developPerson:null
LOG: is:false
LOG:state:
The is my code in attribute customization:
(two attribute are workItem.owner and a attribute customization that type is owner)
dojo.provide("org.example.validateDevelopPerson");
dojo.require("com.ibm.team.workitem.api.common.Severity");
dojo.require("com.ibm.team.workitem.api.common.Status");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var Severity= com.ibm.team.workitem.api.common.Severity;
var Status= com.ibm.team.workitem.api.common.Status;
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
var validateDevelopPerson= dojo.declare("org.example.validateDevelopPerson", null, {
validate: function(attributeId, workItem, configuration) {
var severity= configuration.getChild("parameters").getStringDefault("severity", Severity.ERROR.name);
var message= configuration.getChild("parameters").getStringDefault("message", "");
var state = workItem.getValue(WorkItemAttributes.STATE);
console.log("attributeId:"+attributeId)
var developPerson = workItem.getValue(attributeId);
console.log("developPerson:"+developPerson)
console.log("isAttribute:"+workItem.isAttributeSet(attributeId))
var owner = workItem.getValue(WorkItemAttributes.OWNER);
console.log("state:"+state)
if(state === null){
return Status.OK_STATUS;
}
else{
if(state==="com.ygsoft.workflow.interiorDebugBill.state.s4"){
if(developPerson===owner){
return Status.OK_STATUS;
}else{
return new Status(Severity[severity], message);
}
}else {
return Status.OK_STATUS;
}
}
}
});
})();
log message print:
LOG:developPerson:null
LOG: is:false
LOG:state: