<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Email other approvers that at least one approver has approved the hr case in HRSD forum</title>
    <link>https://www.servicenow.com/community/hrsd-forum/email-other-approvers-that-at-least-one-approver-has-approved/m-p/2876368#M35547</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get the platform to&amp;nbsp;"Email other approvers that at least one approver has approved the record".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, when a recruitment hr case is raised, an (group) approval record is generated with approval records assigned to the users. the Flow is such that ALL approvers have to approve in order for the approval to be accepted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My requirement is to auto send an email to the remaining group members ONCE someone in the group has approved from their end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have followed this to no avail:&amp;nbsp;&lt;A href="https://www.servicenow.com/community/developer-forum/how-to-send-an-email-notification-to-individual-group-member-if/td-p/2221891" target="_blank" rel="noopener"&gt;How to Send an email notification to individual gr... - ServiceNow Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The event does not fire thus a notification is not triggered.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure where I'm going wrong here, i've attached a screenshot of the business rule run conditions (sysapproval_approver table) and here is the script used:&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(function executeRule(current, previous /*null when async*/) {

	// Add your code here

var approverList = [];

var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sysapproval);
gr.addQuery('sys_id', '!=', current.sys_id);
gr.query();

while (gr.next){
approverList.push(gr.approver.email);

}

gs.eventQueue('approval.approved.by.other', current, approverList.toString());

})(current, previous);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Mar 2024 15:53:59 GMT</pubDate>
    <dc:creator>Taza</dc:creator>
    <dc:date>2024-03-25T15:53:59Z</dc:date>
    <item>
      <title>Email other approvers that at least one approver has approved the hr case</title>
      <link>https://www.servicenow.com/community/hrsd-forum/email-other-approvers-that-at-least-one-approver-has-approved/m-p/2876368#M35547</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get the platform to&amp;nbsp;"Email other approvers that at least one approver has approved the record".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, when a recruitment hr case is raised, an (group) approval record is generated with approval records assigned to the users. the Flow is such that ALL approvers have to approve in order for the approval to be accepted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My requirement is to auto send an email to the remaining group members ONCE someone in the group has approved from their end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have followed this to no avail:&amp;nbsp;&lt;A href="https://www.servicenow.com/community/developer-forum/how-to-send-an-email-notification-to-individual-group-member-if/td-p/2221891" target="_blank" rel="noopener"&gt;How to Send an email notification to individual gr... - ServiceNow Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The event does not fire thus a notification is not triggered.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure where I'm going wrong here, i've attached a screenshot of the business rule run conditions (sysapproval_approver table) and here is the script used:&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(function executeRule(current, previous /*null when async*/) {

	// Add your code here

var approverList = [];

var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sysapproval);
gr.addQuery('sys_id', '!=', current.sys_id);
gr.query();

while (gr.next){
approverList.push(gr.approver.email);

}

gs.eventQueue('approval.approved.by.other', current, approverList.toString());

})(current, previous);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 15:53:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/email-other-approvers-that-at-least-one-approver-has-approved/m-p/2876368#M35547</guid>
      <dc:creator>Taza</dc:creator>
      <dc:date>2024-03-25T15:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Email other approvers that at least one approver has approved the hr case</title>
      <link>https://www.servicenow.com/community/hrsd-forum/email-other-approvers-that-at-least-one-approver-has-approved/m-p/2876654#M35553</link>
      <description>&lt;P&gt;Did you also create the event definition for the below event? Also you BR condition doesn't look correct. It should say state changes to approved instead of state = requested.&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;approval.approved.by.other&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 20:06:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/email-other-approvers-that-at-least-one-approver-has-approved/m-p/2876654#M35553</guid>
      <dc:creator>SanjivMeher</dc:creator>
      <dc:date>2024-03-25T20:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Email other approvers that at least one approver has approved the hr case</title>
      <link>https://www.servicenow.com/community/hrsd-forum/email-other-approvers-that-at-least-one-approver-has-approved/m-p/2877421#M35567</link>
      <description>&lt;P&gt;I have indeed created the event named "approval.approved.by.other".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the email to trigger when an approver has approved it from their side so that the notification is sent to the remaining approvers. If I change the condiiton to state changes to approved, it would only fire the event once everyone has approved right?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 11:48:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/email-other-approvers-that-at-least-one-approver-has-approved/m-p/2877421#M35567</guid>
      <dc:creator>Taza</dc:creator>
      <dc:date>2024-03-26T11:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Email other approvers that at least one approver has approved the hr case</title>
      <link>https://www.servicenow.com/community/hrsd-forum/email-other-approvers-that-at-least-one-approver-has-approved/m-p/2878001#M35573</link>
      <description>&lt;P&gt;No. Every user will have an individual sysapproval_approver record linked to a Group Approval. So you need to have the condition state changes to Approved, in order for the BR to know that one approver has approved.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 16:32:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/email-other-approvers-that-at-least-one-approver-has-approved/m-p/2878001#M35573</guid>
      <dc:creator>SanjivMeher</dc:creator>
      <dc:date>2024-03-26T16:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Email other approvers that at least one approver has approved the hr case</title>
      <link>https://www.servicenow.com/community/hrsd-forum/email-other-approvers-that-at-least-one-approver-has-approved/m-p/2880255#M35614</link>
      <description>&lt;P&gt;I'll give this a go thanks&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 09:11:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/email-other-approvers-that-at-least-one-approver-has-approved/m-p/2880255#M35614</guid>
      <dc:creator>Taza</dc:creator>
      <dc:date>2024-03-28T09:11:40Z</dc:date>
    </item>
  </channel>
</rss>

