It's all about the answers!

Ask a question

javascript value provider default description


Eray ─░zgin (11611724) | asked Mar 12 '12, 10:12 a.m.
edited Mar 21 '13, 12:10 p.m. by Ralph Schoon (63.3k33646)
I try to use javascript in rtc to set default value for description area.
https://jazz.net/wiki/bin/view/Main/AttributeCustomization

dojo.provide("com.example.common.DefaultDescription");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");


(function() {

var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
var instruction= "";

var instructions= {
"project": "Please see http://jazz.net/project",
"other": "Please see http://jazz.net/other",
"test": "Please see http://jazz.net/test"

}

dojo.declare("com.example.common.DefaultDescription", null, {

getDefaultValue: function(attribute, workItem, configuration) {
var type= workItem.getValue(WorkItemAttributes.TYPE);
instruction= instructions;
return instruction;
}
});

})();

It works successfully. But
when I select a new workitem project typed , description area is set "Please see http://jazz.net/project" correctly,
then before saving workitem , I change workitem type to other, description area isn't refreshing. It must be "Please see http://jazz.net/other" for other type.

One answer



permanent link
Ralph Schoon (63.3k33646) | answered Mar 21 '13, 12:11 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi, you need to have enough dependent attributes for description configured that trigger the value provider. see https://jazz.net/library/article/1093 Lab 5 for a similar approach.

Your answer


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