javascript value provider default description
![]()
Eray İzgin (116●16●23)
| asked Mar 12 '12, 10:12 a.m.
edited Mar 21 '13, 12:10 p.m. by Ralph Schoon (62.0k●3●36●43)
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
![]()
Ralph Schoon (62.0k●3●36●43)
| 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.
|