Use If condition if requestor is requesting for others, approval go to requestor for in workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 06:05 AM
Hi all,
I have a requirement to use if condition in workflow, when requestor is raising requests for others, then approval should go to requestor for.
I tried using OOB conditions like "Requestor For" is different from "submitted by" but this condition did not work. Is there any way to achieve this requirement please?
Thanks,
Saran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 10:29 AM
If you are referring to the (legacy) workflow accessed via workflow editor, as opposed to flow designer, you can do this in the Approval - User activity itself. Leave the Approvers section empty, check the Advanced box, then your script would look something like this:
answer = [];
if (current.request.requested_for != current.opened_by) {
answer.push(current.request.requested_for.toString());
} else {
answer.push(current.request.requested_for.manager.toString());
}
This is grabbing the Requested for from the REQ record. If you are otherwise taking steps to populate the Requested for on the RITM record, use
current.requested_for.toString()
instead, or if this is only in a Catalog Item variable, use
current.variables.requested_for.toString()
instead - where requested_for is the name of the variable. You didn't specify who the approval should go to if Requested for and Opened by are the same person, so I just guessed at the Manager of the Requested for.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2024 03:21 AM
Hi
I have two another requirement for approval activity.
- Requirement-
Manual entry approval should be added before a group approval activity and this manual entry should be added by a manager's group.
The sequence of workflow is:
Line approval--> manual entry approver--> wait for condition--> Group approval activity--->Req in progress.
Could you please help me out with the script to add manual entry approver by a group (group managers) then group approval activity should be triggered but wait for condition should work till manual entry approval is added.
- Requirement-
Approval Sequence:
Group owner approval (This owner should be the approver, auto populated from a form ‘Variable type is Single line Text’) -->Then Manual entry of approval (if group owner is empty, auto populated from form) ---> Wait for condition (until manual entry of approval is added by a group) ---> Group approval activity.
Could you please help me out with the script to add group owner approval (populated from the form 'Variable name is adm_group_owner and type is Single line Text '), if group owner is empty populated from the form, then Secret Server team to manually add the Group owner approval before secret server approvers. If no pending approvals, then REQ moves to in progress.
Note: Group owner approval Variable name is adm_group_owner and type is Single line Text.
Please help me out with the script to capture the sys id of the user populated in the form then add the same user in the approver list.
Thanks,
Saran.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2024 02:42 AM
Hi @Brad Bowman
I have used the below if condition and it worked. Thanks for your help!
Thanks,
Saran.