Computing the ValueSet workItem script or adding values to a drop down list.
I’m trying to get the value of a custom attribute from a ValueSet workItem script or add values to a drop down list from a plugin. Is there a way in Rational to use the function (i.e. getValueSet) below while at the same time use Configuration to get the value of a custom attribute? If not, is there a way to set a list of values into a drop down list from a plugin? I created a plugin in RTC but it seems like it could only set a single value to an attribute programmatically. Is there a function in RTC that would allow me set values to a drop down list? Thanks!
It seems like I can do either: getValueSet: function(attributeId, workItem, context) OR getValueSet: function(attributeId, workItem, configuration) but NOT have both context and configuration as parameters. E.g. getValueSet: function(attributeId, workItem, context, configuration) On the plugin side, I’m setting passing an arraylist to the drop down attribute but the drop would only accept a single string E.g. workItemCopy.setValue(attribute, list); |
3 answers
Ralph Schoon (63.6k●3●36●46)
| answered Nov 02 '12, 5:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I have not really done a lot with value sets, so this is a bit theoretical. As far as I have looked, a value set is a list of attribute values. In a plugin you would use the setValue() with a list of attribute values you want. In a plug in getValue would provide you with a list so that you can debug how it is created. Value sets might not be supported in script based extensions. I have not tried that however. I just know that you can't feed a contributor list using work item customization today.
The rest of the question is confusing me. It appears to mix Java script and Java. Script based extensions and plug ins. Please clarify the context you are talking about. In general a drop down list in the UI is most likely fed by the attribute value. You can't modify the drop down list or any other representation. The presentation would show the available values based on the enumeration etc. If you want to provide other values, you could create a custom value provider as an extension. You can also use script based value sets which put the available values or a filtered http based value provider. |
Hi Ralph,
I'm currently using a plugin to add a list of values to a value set attribute. I've been unsuccessful so far, so I'm hoping for some help. I have a drop down list that I've assigned to a workItem value set attribute in RTC. Now I'm trying to populate the drop down list by using a plugin to add a list of values to the Value Set attribute. The value set attribute is a drop down list. I'm using the setValue() to do this, but I keep getting the error wrong collection type. What type of collection can I to store values then add to the setValue() method? I tried using a List, Map, ArrayList , etc. Is a value set attribute appropriate for doing something like this? Thanks! |
Ralph Schoon (63.6k●3●36●46)
| answered Nov 08 '12, 1:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I didn't have the opportunity so far, to have a deeper look at it. Sorry. I recon, that If I do a getValue() I get a list. In the scripts you push values to value sets. If you want to create a value set provider, I would suggest looking into the SDK hunting for attribute list types.
|
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.