dynamic approval group
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 08:34 AM
Hi,
I have a request for a catalog item where a user can request membership in a selected by him group. This request should be approved by the manager of this group.
Since step based flow does not have this functionality (I need to define approval group immediately and it is not flexible).
What is the recommended way of handling this request? How can I modify the approval group?
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 08:56 AM
Hi @dev_K ,
You can add a new node for group approval, under the advanced option write the below example of code. Modify accordingly based on your variable values.
(function() {
var groupId = current.variables.group; // Replace 'group' with your catalog variable name
var answer = []; // Initialize the answer array to hold approvers
if (groupId) {
var groupRecord = new GlideRecord('sys_user_group');
if (groupRecord.get(groupId)) {
var groupManager = groupRecord.getValue('manager');
if (groupManager) {
answer.push(groupManager); // Add the manager's Sys ID to the answer array
}
}
}
})();
"If this response was useful, please select 'Accept as Solution' and mark it as 'Helpful.' This helps me provide better answers and assists the community ".
Regards,
Pradeep
Regards,
Pradeep