Script in Workflow -to send approval request to the Approver selected from a Group can only approve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2023 11:18 PM
I'm having an IT_TLT group. An approver let's say "ABC" is selected from this group and now the approval request along with an approval notification should go to this approver "ABC" only not to the whole group. I need a script for geeting this done using workflow as the selection of approver is based on it's selection in the portal by the user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2023 12:55 AM
Hi @Sumit Mahto ,
can you share the work flow screenshots?
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2023 01:21 AM - edited ‎12-14-2023 06:45 PM
yes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2023 01:57 AM
Hi @Sumit Mahto ,
you need to use below on run script and use that WF scratchpad variable on on notification.
workflow.scratchpad.mail=current.approval.mail // you need to get the approval mail and store it on workflow scratch pad variable.
you can use workflow.scratchpad.mail in Addressee
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2023 08:37 AM
Hi @Pavankumar_1 ,
I tried the above mentioned but it doesn't worked.
Was there anything wrong in the script above I used? And along with the notification I want approver request to go the selected approver.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2023 08:49 AM - edited ‎12-12-2023 08:53 AM
Hi @Sumit Mahto ,
if you use exactly it wont work first you need to get the approver mail of the approver and store it on the scratchpad variable and use it on notification.
If current workflow table and approver on same table then you directly use that as below
answer=current.approval.mail //replace with your names
Try to add logs and check the values.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar