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

Acces Enumeration with Javascript Condition

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.

0 votes


Accepted answer

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

0 votes


One other answer

Permanent link
Ok ,thanks Ralph!!

I try with another enumeration and its OK!, but the problem is my "i" accent (tipología) doesn't work, i think..

0 votes

Comments

I would suggest to avoid any special caracters in these ID's. I am not sure if this is intented to be supported. If you think it is necessary, I would suggest you write a work item.

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
× 152

Question asked: Jul 30 '12, 5:42 a.m.

Question was seen: 5,416 times

Last updated: Mar 21 '13, 11:27 a.m.

Confirmation Cancel Confirm