Approvals skipped due to to invalid rule syntax in flow designer error logs

Harsha Pandey
Tera Expert

Hi,

 @Chuck Tomasi @Mike Reading @Ankur Bawiskar 

My second level approval got skipped and I can find this error in logs 

Flow Designer: Operation((SC) Change - Normal - Authorize_v1.Branch$1.1f76e11c87bf09d4605d32a73cbb3526.If$1.5b76e11c87bf09d4605d32a73cbb352c.6776251c87bf09d4605d32a73cbb35b4.5df22d920b10030085c083eb37673a04.Create Approvals) skipped due to invalid rule syntax:

Below is my flow designer and we are using a custom action here with scripted rule in ask for approval.

1st level approval at Assess state which would be Primary Service Offering change group.
2nd level approval as per below screenshot at Authorize state which is Cis Approval group in Impacted Service related list with class as service offering.(TSO APV group).

SC get offering approval group is the custom action with below script:

(function execute(inputs, outputs) {

  var grChange = inputs.change_request;
  var groupIDs = [];
  var arrUtil = new ArrayUtil();

  
  var grOffering = new GlideRecord('task_cmdb_ci_service')
  grOffering.addQuery('task', grChange.sys_id.toString());
  grOffering.addQuery('cmdb_ci_service.sys_class_name', 'service_offering');
  grOffering.addQuery('cmdb_ci_service.change_control', '!=', '');
  grOffering.groupBy('cmdb_ci_service.change_control');
  grOffering.query();
  while(grOffering.next()){
    var grmember = new GlideRecord('sys_user_grmember');
    grmember.addQuery('group', grOffering.cmdb_ci_service.change_control);
    grmember.addQuery('user.active', true);
    grmember.query();
    if(grmember.hasNext()){
      groupIDs.push(''+grOffering.cmdb_ci_service.change_control.sys_id.toString());
    }
    
  }
  groupIDs = arrUtil.unique(groupIDs); // remove duplicates
  outputs.group_ids = groupIDs.toString();
})(inputs, outputs);

 

find_real_file.png

find_real_file.png

Thanks,

Harsha

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

is this happening always?

regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur, No, not always, it is an intermittent issue. Thanks

Hi Ankur,

Could you please take out some time to look into this issue. Need your help!!!!!!!

 

Thanks,

Harsha

Mahendra RC
Mega Sage

Hello Harsha,

Could you also please share the Scripted rule that is written in your flow it will be easy to understand and more helpful. I believe your instance is not domain separated right?

Also in the mean time can you check by adding the condition:

var grmember = new GlideRecord('sys_user_grmember');
    grmember.addQuery('group', grOffering.cmdb_ci_service.change_control);

    grmember.addQuery('group.active', true);
    grmember.addQuery('user.active', true);
    grmember.query();
    if(grmember.hasNext()){
      groupIDs.push(''+grOffering.cmdb_ci_service.change_control.sys_id.toString());
    }

Thanks