need to know from which script Delegate gets mail

rohit331
Tera Expert

Hi All,

Need to know from which script Delegate gets the mail. we have a custom requirement, Suppose A raise a request and approval get to B. So now if B set the delegate to A then approval email should not get to A. Can any one have any idea on it.

4 REPLIES 4

dravvyramlochun
ServiceNow Employee
ServiceNow Employee

Hello Rohit,



I would say there is a BR which is responsible for deletae approval:


https://<instance_name>.service-now.com/nav_to.do?uri=sys_script.do?sys_id=d59048357f00000101201a5caa73fc8e


Delegate approvals and tasks to another user



Maybe this can help you.



Reference:


How does delegation work?


http://wiki.servicenow.com/index.php?title=Service_Delegation#Adding_the_Delegates_Related_List_to_U...


2 Adding the Delegates Related List to User Profiles

By default, the Delegates related list is hidden from the User Profile form. An administrator or a user with the personalize_form role must add the Delegates related list to the User Profile form.


Delegate related listDescription
Delegates->DelegatesShows a list of users for whom the current user is a delegate. For example, if the current user is the ITIL User, the list shows users where Delegate = ITIL User.
Delegates->UserShows a list of users who are delegates of the current user. For example, if the current user is the ITIL Admin, the list shows delegates where User = ITIL Admin.
  1. Navigate to Self Service > My Profile.
  2. Configure the form and add the Delegates->User related list.

3 Delegating Approvals and Tasks to Another User

If a user is out of the office, s/he can delegate responsibilities to other users for a period of time. To make another user your delegate:


  1. Navigate to Self Service > My Profile.
  2. In the Delegates related list, click New.
    If the list is not visible, configure the form to add the Delegate->User related list.
  3. Select the Delegate (User).
  4. Set the period of time.
  5. Specify the responsibilities the delegate will assume using the check boxes. You can delegate:
  • Approvals: The delegate can approve items on your behalf.
  • Assignments: The delegate can view and work on tasks assigned to you.
  • CC Notifications: The delegate receives a copy of email notifications sent to you, except those marked Meeting Invitation.
  • Meeting Invitations: The delegate receives a copy of email notifications sent of the type Meeting Invitation.

Note


Note: You must select an active user as your delegate. The instance only delegates to active users.

gauravchoudhury
Tera Guru

Hi Rohit,



How the actual delegation works:



  • A specific delegate has a start date, end date, and properties like Approvals.
  • "My Approvals" module uses the function getMyApprovals() has the filter for the approval. This is actually the function leveraging the delegates.
  • There are read, write and delete ACLs used to manage access to the approval record. The function used here is isApprovalMine(record_sys_id).
  • The checkAllApprovers(approver) function is then calling back the getMyApprovals() function.
  • There is also the approval emails that are only sent if the CC Notifications was checked but this is sending every notifications and not only specific approvals. To leverage notifications delegate for only specific approvals you would probably have to script this in an event parameter of the approval.inserted getting called by either the "Approval Events (Task)" business rule or the "Approval Events (Non-Task)" business rule.


The three functions referred to are defined in the "getMyApprovals" business rule.



So based on your need, the three business rule tat have been mentioned is where you should look for to code your required logic.



You can either modify the OOTB business rules or copy them and change the function names and update the function being called every where they are called.



Source: Link


Hi Gaurav,


I need only notification part. till now not able to find any script. Can you tell me which script send delegate mail.


Hi Rohit,



Try this: https://<<instance_name>>.service-now.com/nav_to.do?uri=/sysevent_email_action_list.do%3Fsysparm_query%3Dactive%253Dtrue%255EnameLIKEDelegate%26sysparm_first_row%3D1%26sysparm_view%3D%26sysparm_choice_query_raw%3D%26sysparm_list_header_search%3Dtrue



find_real_file.png