I want to trigger a task based on MRVS choice.

Taaha M
Tera Contributor

I am trying to trigger a task in workflow based on choice selected in MRVS. 
I am trying to do in a script using a if in workflow but it is not triggering.

 

var testRoles = [

          'sys_id of choice1 in selectbox'

          'sys_id of choice2' 

      ];

      var mrvs = current.variables.mrvs_name;

      try {

          var actions = JSON.parse(mrvs);

      } catch (ex) {

          gs.error('Failed to parse mrvs due to error: ' + ex);

          return 'no';

      }

      for (i = 0; i < actions.length; i++) {

          //if (actions[i].hasOwnProperty('variame_name_of_choice') &&

          if (testRoles.indexOf(actions[i],variame_name_of_choice) != -1) {

              return 'yes';

          }

          return 'no';

      }

  }

2 REPLIES 2

I am trying to trigger based on choice selected on field.