It's all about the answers!

Ask a question

Issue in writing script for Dynamic read only attribute using customized attribute

Sachin Nairy (5111220) | asked Jul 23 '12, 4:42 a.m.

Hi All,


I am facing issue in writing script for Dynamic read only attribute.

I created one enumeration “Project Type” with some values.

ID = Projecttype

Name = Project Type

Literal = Projecttype.literal.l2


I tried with example script which is working fine but it is not working for customized attribute


I got confused while passing the attribute ID, for built-in attribute we are passing


What about built in attribute?


Please help me to resolve this issue.



Working Script:






(function() {

var WorkItemAttributes=;


dojo.declare("org.example.workitems.providers.FinishedCondition", null, {


    matches: function(workItem, configuration) {

        var state= workItem.getValue(WorkItemAttributes.PRIORITY);


        return (state === "priority.literal.l11"); // High







Not Working Script:






(function() {


dojo.declare("org.example.workitems.providers.FinishedCondition", null, {


    matches: function(workItem, configuration) {

        var type= workItem.getValue(Projecttype);


        return (type === "Projecttype.literal.l2"); // Project




Millard Ellingsworth commented Jul 23 '12, 8:18 p.m.

Have you debugged into the script? Is the value of your variable "type" getting set to a value you recognize? Since you need to pass in the ID value for the variable, you may need to put "Projecttype" in quotes -- I can't tell what the dojo.require("Projecttype") is doing as I can't see the contents of that file. In the comparable call in the working script, the dojo.require() loads a JavaScript file with a series of constant definitions that can be used in the getValue() call.

Accepted answer

permanent link
Gabriel Enriquez (3463) | answered Jul 24 '12, 1:32 a.m.
There is not need to use:

Within the body of the function,
to retrieve the label:

or to retrieve the id:

Where: <attributeId> is the custom attribute ID of the work item type.

Gabriel Enriquez, IBM Rational, Tracking & Planning
Sachin Nairy selected this answer as the correct answer

Your answer

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