Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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?

0 votes



One answer

Permanent link
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.

0 votes

Comments

Ralph,


But How to do that based on fact that attribute isn't loaded yet with value script provider?

If this was loaded on creation, maybe I could get the values... 

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

Your answer

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,131

Question asked: Jan 27 '15, 8:51 a.m.

Question was seen: 3,475 times

Last updated: Jan 28 '15, 3:22 a.m.

Confirmation Cancel Confirm