It's all about the answers!

Ask a question

Setting up multiple conditions in a java script for use with Required Attributes for Condition

Karen Steele (1.2k2136141) | asked Jul 09 '18, 6:39 p.m.

need to setup a java script that looks at three attributes - and based on that condition make fields mandatory using the Required Attributes for Condition

I have the following, but it does not appear to be working


(function() {
    dojo.declare("com.example.migrationprodemerg", null, {

        matches: function(workItem, configuration) {
        var workitem =;
        var environment = workItem.getValue(workitem.migration.prodnonprod);
    var state = workItem.getvalue(workitem.state);
    var migrationtype = workItem.getValue(workitem.migration.type);

        if (environment == "migration.prodnonprod.literal.l2" && migrationtype == "migration.type.literal.l4" && state != "") {

           return true;
           return false;

Basically the script is looking for the value of preprod + emergency and a workflow state that is NOT "initial"

Any help gratefully appreciated.

One answer

permanent link
Ralph Schoon (63.2k33646) | answered Jul 10 '18, 2:24 a.m.
edited Jul 10 '18, 3:45 a.m.

Unfortunately the question is so terribly written, that I can not even begin to answer. Please read How should I ask a question in the Forum if I want to receive useful answers?

What does "does not work" mean? E.g. what do you see and what have you done.

You can play with code and for example always return true or false to see if it works in principle.
In addition it makes sense to either debug if possible (Use Crome Developer tools) or to log/output data. E.g. to check your assumptions about the values you test against.

In addition the documentation might be useful: see the section about ID's of state values.

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.