- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2022 09:39 AM
objective: in order to find the right approver, need to dot walk the requested_for.manager path until manager is a member of a particular group, and then use that manager for the approval. i'm open to this being a script in workflow but it seems like i should be able to make a "is an exec" subflow and put into a catalog flow loop to check, so that it is re-usable
so i'm envisioning a catalog item flow:
flow start
do the following until approval user is an exec:
dot walk requested_for.manager.manager
subflow to check if the current manager is part of group Exec
set approver
<..do whatever other item flow stuff ..>
flow end
can anyone lend insight though how to accomplish the dot walking up the manager chain, then input to the subflow to verify if part of group = exec?
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2022 12:36 PM
Either one, but you'll need to account for the possibility that it returns undefined.
e.g., for a workflow activity you'd change the 4th line to
answer = FindApprover(user, group);
and delete the gs.info line.
If there's a fall-back for an approver not found you can do something like:
var approvalUser = FindApprover(user, group);
if (approvalUser) {
answer = approvalUser;
}
else {
answer = 'fall_back_user';
}
You can also turn it into a script include and call it from wherever you want 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 05:51 AM
Chris
with this great script, any ideas for handling the use case of if a Manager in that dot walk is Missing?
(currently if the mgr is missing the whole workflow bypasses any approvals ) it also seems to bounce through the FindApprover script without finding the matching approver.
if user in the dotwalk is just inactive, it appears to still walk up the chain to find the matching approver, so i think i'm ok there.
i dont see anything in the script you provided that is filtering for only Active users though, unless its somethin builtin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2022 06:41 AM
again thanks so much for helping with the original post!