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

What is the syntax to be used to make the list type enum attributes required using conditional scripting in RTC?

Hi All,

I am trying to write conditional scripting to make the list type custom enum attribute required and not allowing to save  in Attribute customization section..

I have applied the Required Attribute preconditions according to role ,, the script works fine for notmal attributes like priority but when i built this for custom list type enum attribute m not able to succeed.


dojo.provide("com.example.Condition1");

(function() {
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
    dojo.declare("com.example.Condition1", null, {

        matches: function(workItem, configuration) {
        var WItype = workItem.getLabel(WorkItemAttributes.TYPE);
        var brand = workItem.getLabel("Brands");
      
        var PA = workItem.getLabel(WorkItemAttributes.PROJECT_AREA);

       
        if( WItype == "Feature" )
        {
         if( brand == null)
         {
             return 1;
           }
           
            else
            {return  0;
            }
            }
        }

    });
})();

In the above script  brands is and list type enum .. But i failed to make the script to behave normally ?
Is there any issue with my above query? or any syntax ti be used  specially for enum list type attribute.

Thank you



0 votes



One answer

Permanent link

You can make an Enumeration List attribute mandatory the same way as other attributes. You need the "Required Attributes For Condition" precondition. Don't worry about the logic in your script - for testing purpose, you should just use a script as simple as "return true" (the example script is exactly what you need).

0 votes

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
× 7,495
× 1,700
× 1,220

Question asked: Dec 14 '17, 6:47 a.m.

Question was seen: 2,409 times

Last updated: Dec 19 '17, 1:20 a.m.

Confirmation Cancel Confirm