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

Calculated value script using checkboxes values

Hello !
I need to get the enumeration values with checkboxes. I need to get all the values ​​that are checked, but the code below does not work, because returns null.
var complexidade = workItem.getValue("criteriosPriorizacao"); 

The xml is as follows :

<enumeration attributeTypeId="criteriosPriorizacao" name="Critérios de Priorização">
   <literal externalValue="6" icon="" id="criteriosPriorizacao.literal.l1" name="CheckBox 1"/>
   <literal externalValue="5" icon="processattachment:/enumeration/critical.gif" id="criteriosPriorizacao.literal.l3" name="CheckBox 2"/>
   <literal externalValue="4" icon="" id="criteriosPriorizacao.literal.l4" name="CheckBox 3"/>
   <literal externalValue="3" icon="" id="criteriosPriorizacao.literal.l5" name="CheckBox 4"/>
   <literal externalValue="2" icon="" id="criteriosPriorizacao.literal.l6" name="CheckBox 5"/>
   <literal externalValue="1" icon="" id="criteriosPriorizacao.literal.l7" name="CheckBox 6"/>
   <literal default="true" externalValue="0" icon="" id="criteriosPriorizacao.literal.l2" name="Nenhum"/>
</enumeration>


How do I get the checkboxes that are checked?
Thanks!

0 votes


Accepted answer

Permanent link
This article: https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript indicates that there is limited support for working with enumerations via the JavaScript API. Further down in that article there is a section on working with enumerations: https://jazz.net/wiki/bin/view/Main/AttributeCustomization#WorkingWithEnums

I'm not certain, but the name on that second one may be problematic: "name="&lt;span style=" line-height:="" 1.5;"="">CheckBox 2"/>"

Tayane Fernandes selected this answer as the correct answer

0 votes

Comments

Thank you!

The xml is correct in my code, must have been some mistake when I pasted it here.

I just finished up an article that may help: https://jazz.net/library/article/1360 

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

Question asked: Oct 23 '13, 4:22 p.m.

Question was seen: 5,077 times

Last updated: Nov 18 '13, 8:39 p.m.

Confirmation Cancel Confirm