Approvals skipped due to to invalid rule syntax in flow designer error logs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 01:00 AM
Hi,
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);
Thanks,
Harsha
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 01:45 AM
Hi,
is this happening always?
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 08:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 11:47 PM
Hi Ankur,
Could you please take out some time to look into this issue. Need your help!!!!!!!
Thanks,
Harsha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 09:28 AM
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