ConstThe approval rules configuration object
A string representation of the approval rules for Flow Designer
//Any user or group member from a list can approve or reject
const simpleRules = wfa.approvalRules({
conditionType: 'OR',
ruleSets: [{
action: 'Approves',
conditionType: 'AND',
rules: [{
rule_type: 'Any',
users: ['user_sys_id_1', 'user_sys_id_2'],
groups: [],
manual: false
},
{
rule_type: 'Any',
users: ['user_sys_id_3'],
groups: ['group_sys_id1'],
manual: false
}]
},
{
action: 'Rejects',
conditionType: 'AND',
rules: [{
rule_type: 'Any',
users: ['user_sys_id_4', 'user_sys_id_5'],
groups: ['group_sys_id_2'],
manual: false
}]
}]
})
ApprovalRules configuration to use in Fluent Flows
Ask for Approvalaction.This function converts a structured approval rules object into the string format expected by ServiceNow Flow Designer. The rules define who can approve or reject a flow and under what conditions.
Rule Structure:
Rule Types:
Any: Any user or any group member can approve or rejectAll: All users and all group members need to approve or rejectRes: All responded and anyone approves or rejectsCount: Specific number of approvals required to approve or rejectPercent: Percentage of approvals required to approve or reject