workflow approvals should create
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
There is a catalog item and in that there are 2 fields one is "group name" referring to group table and another one is radio buttons field (select_action) conatins 4 options
if "select_action" variable selected "update approval deputies" or "update mailbox" then approval should goes to selected group manager.
if "select action" variable selectes "deactivate a group" or "other" then two approvals should create
1. group manager approval and second approval is "L2 group approval"
if group does not have manager then the entore request should be cancelled.
how can i achieve this in workflow.
(backened names )
if (axa_sesd_select_action_var = Update approval deputies OR Update Mailbox)
then only group manager approval (the group selected in the above field)
if(axa_sesd_select_action_var = Desactivate a group OR Other)
then 2 approvals should trigger
one is selected group manager approval and second one is default group (L2 group)
if selected group does not have manager then request should be cancelled.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
We are using Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Hemanth M ,
If axa_sesd_select_action_var = "Update Approval Deputies" or "Update Mailbox", the request should go only to the Manager Approval stage. After the manager approves the request, the system should automatically update or remove the deputies, or update the mailbox as requested. Once approved, the user should automatically be added to the Deputies group or Mailbox.
If axa_sesd_select_action_var = "Deactivate a Group" or "Other", the first approval should be from the Manager, followed by a second approval from the L2 Group.
Note: All functionalities are working as expected except for the approval workflow. Could you please guide me on what might be wrong in the code or workflow configuration?
Thanks,
Srinath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @sinu2
here are 2 fields one is "group name" referring to group table -> This means groupSysID not groupName
answer = []; // Initialize approver list
var groupSysId = current.variables.axa_sesd_group_name_var + ''; // Reference variable contains group sys_id
var action = current.variables.axa_sesd_select_action_var + ''; // Selected radio button value
var grp = new GlideRecord('sys_user_group');
if (grp.get(groupSysId)) {
if (gs.nil(grp.manager)) { // Better to use nil to handle both empty as well as null values.
current.state = 4;
current.work_notes = 'Selected group has no manager.';
current.update();
} else {
// Add group manager as approver
answer.push(grp.manager.toString());
// Add L2 approver for specific actions
if (action == 'Desactivate a group' || action == 'Other') {
answer.push('981c4bbd87b0c6908530fd99cebb35e6');// Best Practice: Store this sys_id in a System Property instead of hardcoding and ensure to add role to the system property.
}
}
}
Hope that helps!
