1344 views

Description

When using the Advanced script field to build a list of users or groups approvals in the Approval - User or Approval - Group activity, scripts that return a list of user or group IDs no longer trigger approvals to be created. Returning a list of user or group sys_ids works.

Steps to Reproduce

 

  1. Create a flow on the incident table that contains an Approval - Group activity, and set that activity's Advanced additional approver script to:

     answer = [];
    answer.push('abraham.lincoln');
    answer.push('CAB Approval');

    You can instead import the attached workflow if desired.

  2. Create a new incident that will trigger a flow execution

  3. The flow should generate user approvals for Abraham Lincoln and all the members of the CAB approval group.

 

 

Workaround

  1. Update the two methods in the script include WorkflowApprovalUtils with the following code:

    _isValidUser: function(id) {
       var usr = new GlideRecord("sys_user"); 
       var query = usr.addQuery("sys_id", id); 
       query.addOrCondition("user_name", id);
       usr.queryNoDomain();
       return usr.hasNext();
    }, 
     
    _isValidGroup: function(id) {
       var ugr = new GlideRecord("sys_user_group"); 
       var query = ugr.addQuery("sys_id", id); 
       query.addOrCondition("name", id);
       ugr.queryNoDomain();
       return ugr.hasNext();
    },
  2. Remove the related Customer Update [sys_update_xml] record, so that this file will receive future updates.

 

 


Related Problem: PRB1244790

Seen In

There is no data to report.

Intended Fix Version

London

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-03-28 03:41:14
Published:2018-03-28