Acces Enumeration with Javascript Condition
Marcos Sánchez (19●7●11)
| asked Jul 30 '12, 5:42 a.m.
edited Mar 21 '13, 11:27 a.m. by Ralph Schoon (63.3k●3●36●46)
Hi everyone,
I want to have acces a workitem enumeration with Javascript. My enumeration config: <attributeDefinition id="tipologíaProyecto" name="Tipología Proyecto" type="silk.tipologiaProyecto"/> <enumeration attributeTypeId="silk.tipologiaProyecto" name="Tipos Proyecto"> <literal icon="processattachment:/enumeration/minor.gif" id="silk.tipologiaProyecto.literal.l2" name="Singular"/> <literal default="true" icon="processattachment:/enumeration/normal.gif" id="silk.tipologiaProyecto.literal.l3" name="NO RTB"/> <literal icon="" id="silk.tipologiaProyecto.literal.l4" name="RTB"/> <literal icon="" id="silk.tipologiaProyecto.literal.l5" name="Servicio Adicional"/> </enumeration> I doing (javascript) dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes; matches: function(workItem, configuration) { var tipo= workItem.getValue(WorkItemAttributes.tipologíaProyecto); alert("Enumeration choice Tipo="+tipo); ... I see: alert (Null) What am I doing wrong? Thanks for advance. |
Accepted answer
Ralph Schoon (63.3k●3●36●46)
| answered Jul 30 '12, 6:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,
you want to use var tipo= workItem.getValue("tipologíaProyecto"). You pass the ID as string. The WorkItemAttributes only has values for the attributes in the list of the wiKi topic. Marcos Sánchez selected this answer as the correct answer
|
One other answer
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.