Using Default Script Base in a Value Set Provider attribute
When a workitem is loaded, we have an attribute called "UG" that is loaded (on click event) with Value Set Provider Script (values is provided from webservice).
How can I set a Default Value to this attribute?
|
One answer
Ralph Schoon (63.6k●3●36●46)
| answered Jan 27 '15, 9:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You can specify a default literal for an enumeration in general.
You can also define a default value provider for an enumeration or enumeration list similar to the value set provider. See https://jazz.net/library/article/1093 Lab 4. Comments
Gustavo Monti Rocha
commented Jan 27 '15, 9:23 a.m.
Ralph,
But How to do that based on fact that attribute isn't loaded yet with value script provider?
Read lab 4 above. The default value kicks in when the work item is CREATED.
Gustavo Monti Rocha
commented Jan 27 '15, 11:02 a.m.
I read lab 4 in this article ( https://jazz.net/library/content/articles/clm/2012/process-enactment-workshop/workbook/pew-rtc-lab-workbook.pdf ) but I didn't find the awnser.
I saw that we can choose the default value (default script base) if my attribute is a enumeration but my attribute loaded with Value Set Provider Script (values is provided from webservice).
Ralph Schoon
commented Jan 27 '15, 11:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Ralph Schoon
commented Jan 27 '15, 11:15 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If you load from a web service it is likely script based - and not enumeration based.
I load from a web service.
How can I load the values (from webservice) using getDefaultValue function?
In getFilteredValueSet function we use the context to retrieve data like this:
var connector= context.getDataConnector("HttpConnector");
The problem is the in getDefaultValue we don't have the context variable:
getDefaultValue: function(attributeId, workItem, configuration) {}
I don't know if is the best to do this.
You can try a script based default value using the HTTP filtered value set in the script like explained here: https://jorgediazblog.wordpress.com/2012/06/27/work-item-customization-httpconector-and-oauth-in-rtc-4-0-for-oslc/
showing 5 of 7
show 2 more comments
|
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.