Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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)

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:attribueId:AtrDevelopResponsePerson
LOG:developPerson:null
LOG: is:false
LOG:state:

0 votes



One answer

Permanent link
 Hi Chen,
                  try to give attributeId in quotes: Is AtrDevelopResponsePerson, the id of the other owner-type attribute?

workItem.getValue("attributeId");
	

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Dec 08 '11, 11:06 a.m.

Question was seen: 4,022 times

Last updated: May 22 '13, 4:32 a.m.

Confirmation Cancel Confirm