Using Default Script Base in a Value Set Provider attribute
One answer
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.
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
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.
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).
- In attribute customization, create default value provider for enumeration list.
-
Select your enumeration and the default you want
- In the work item attributes, select the default value provider now available for your attribute
-
done
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/
But I am not sure if that would work.
showing 5 of 7
show 2 more comments