script-based customization getValue returns null (Newbie question)
![]()
Can't seem to use getValue() or WorkItemAttributes. How do I get these loaded? Is there a configuration someplace to point to these resources?
*****************************************************************************************
This first one works:
******************************************************************************************
dojo.provide("com.example.ValueProvider.basedonstate");
dojo.require("dojo.date");
dojo.require("dojo.date.stamp");
(function() {
dojo.declare("com.example.ValueProvider.basedonstate", null, {
getValue: function(attributeId, workItem, configuration) {
var currentDate= new Date();
var Datestring= dojo.date.stamp.toISOString(currentDate, {milliseconds:true, zulu:true});
return "Date " + Datestring ;
}
});
})();
*********************************************************************************************
This Does not:
*********************************************************************************************
dojo.provide("com.example.ValueProvider.basedonstate");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.date");
dojo.require("dojo.date.stamp");
(function() {
dojo.declare("com.example.ValueProvider.basedonstate", null, {
getValue: function(attributeId, workItem, configuration) {
var typeString = + workItem.getValue(WorkItemAttributes.TYPE);
return "Type: " + typeString ;
}
});
})();
|
2 answers
![]()
needed the line:
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes ;
|
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.