<?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 Re: I need to send notification on employee work anniversary. in Virtual Agent forum</title>
    <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3134030#M13513</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/392741"&gt;@Sai_Charan_K&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me to create cross scope privileges.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nivedita&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Dec 2024 09:25:30 GMT</pubDate>
    <dc:creator>niveditakumari</dc:creator>
    <dc:date>2024-12-23T09:25:30Z</dc:date>
    <item>
      <title>I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3127952#M13302</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to send notification on employee work anniversary.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To achieve that I have created :&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Event&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Schedule Job&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; gr = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;GlideRecord&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'sys_user'&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gr.addQuery(&lt;/SPAN&gt;&lt;SPAN&gt;'active=true^u_hr_hire_dateISNOTEMPTY^nameLIKEnivedita'&lt;/SPAN&gt;&lt;SPAN&gt;);&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gr.query(); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;&lt;SPAN&gt;(gr.next()) { &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; hireDate = gr.u_hr_hire_date; //this field is date of joining&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; hireMonth = hireDate.substring(&lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;7&lt;/SPAN&gt;&lt;SPAN&gt;); //getting month from date of joining&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; hireDay = hireDate.substring(&lt;/SPAN&gt;&lt;SPAN&gt;8&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;); //getting day from date of joining&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; todayDate = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;GlideDateTime&lt;/SPAN&gt;&lt;SPAN&gt;();&amp;nbsp; //getting today date&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; todayMonth = todayDate.getMonth(); // getting today month&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; dayOfMonth = todayDate.getDayOfMonthLocalTime(); // getting today day&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.log(&lt;/SPAN&gt;&lt;SPAN&gt;'hire date is'&lt;/SPAN&gt;&lt;SPAN&gt; + hireDate); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.log(&lt;/SPAN&gt;&lt;SPAN&gt;'hire month is'&lt;/SPAN&gt;&lt;SPAN&gt; + hireMonth); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.log(&lt;/SPAN&gt;&lt;SPAN&gt;'hire day is'&lt;/SPAN&gt;&lt;SPAN&gt; + hireDay); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.log(&lt;/SPAN&gt;&lt;SPAN&gt;'today date is'&lt;/SPAN&gt;&lt;SPAN&gt; + todayDate); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.log(&lt;/SPAN&gt;&lt;SPAN&gt;'today month is'&lt;/SPAN&gt;&lt;SPAN&gt; + todayMonth); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.log(&lt;/SPAN&gt;&lt;SPAN&gt;'today day is'&lt;/SPAN&gt;&lt;SPAN&gt; + dayOfMonth); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(hireMonth == todayMonth &amp;amp;&amp;amp; hireDay == dayOfMonth) { &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c++; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.eventQueue(&lt;/SPAN&gt;&lt;SPAN&gt;'sn_hr_core.work.anniversary.notification'&lt;/SPAN&gt;&lt;SPAN&gt;, gr, &lt;/SPAN&gt;&lt;SPAN&gt;''&lt;/SPAN&gt;&lt;SPAN&gt;, gr.name); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.log(&lt;/SPAN&gt;&lt;SPAN&gt;'notification sent'&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; } &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.log(&lt;/SPAN&gt;&lt;SPAN&gt;'count is'&lt;/SPAN&gt;&lt;SPAN&gt; + c); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;When I'm writing code for nivedita for particular user then it is checking if condition and it is executing code that is written after if condition but when I'm writing code for all user it is not checking if condition.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; c= &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; gr = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;GlideRecord&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'sys_user'&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gr.addQuery(&lt;/SPAN&gt;&lt;SPAN&gt;'active=true^u_hr_hire_dateISNOTEMPTY'&lt;/SPAN&gt;&lt;SPAN&gt;); /////////////////////////////////////////////&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gr.query(); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;&lt;SPAN&gt;(gr.next()) { &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; hireDate = gr.u_hr_hire_date; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; hireMonth = hireDate.substring(&lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;7&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; hireDay = hireDate.substring(&lt;/SPAN&gt;&lt;SPAN&gt;8&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; todayDate = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;GlideDateTime&lt;/SPAN&gt;&lt;SPAN&gt;(); &amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; todayMonth = todayDate.getMonth(); &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; dayOfMonth = todayDate.getDayOfMonthLocalTime(); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.print(&lt;/SPAN&gt;&lt;SPAN&gt;'hire date is'&lt;/SPAN&gt;&lt;SPAN&gt; + hireDate); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.print(&lt;/SPAN&gt;&lt;SPAN&gt;'hire month is'&lt;/SPAN&gt;&lt;SPAN&gt; + hireMonth); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.print(&lt;/SPAN&gt;&lt;SPAN&gt;'hire day is'&lt;/SPAN&gt;&lt;SPAN&gt; + hireDay); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.print(&lt;/SPAN&gt;&lt;SPAN&gt;'today date is'&lt;/SPAN&gt;&lt;SPAN&gt; + todayDate); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.print(&lt;/SPAN&gt;&lt;SPAN&gt;'today month is'&lt;/SPAN&gt;&lt;SPAN&gt; + todayMonth); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.print(&lt;/SPAN&gt;&lt;SPAN&gt;'today day is'&lt;/SPAN&gt;&lt;SPAN&gt; + dayOfMonth); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(hireMonth == todayMonth &amp;amp;&amp;amp; hireDay == dayOfMonth) { &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c++; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.eventQueue(&lt;/SPAN&gt;&lt;SPAN&gt;'sn_hr_core.work.anniversary.notification'&lt;/SPAN&gt;&lt;SPAN&gt;, gr, &lt;/SPAN&gt;&lt;SPAN&gt;''&lt;/SPAN&gt;&lt;SPAN&gt;, gr.name); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.print(&lt;/SPAN&gt;&lt;SPAN&gt;'notification sent'&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; } &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; gs.print(&lt;/SPAN&gt;&lt;SPAN&gt;'count is'&lt;/SPAN&gt;&lt;SPAN&gt; + c); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Can you please help me to correct that code.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Regards,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Nivedita&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 15 Dec 2024 18:08:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3127952#M13302</guid>
      <dc:creator>niveditakumari</dc:creator>
      <dc:date>2024-12-15T18:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3127984#M13303</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/259626"&gt;@niveditakumari&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can probably try using Flow Designer; it will be much more easier.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAIVENKATESH_0-1734296360822.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/407798iCB8935ABB995238C/image-size/medium?v=v2&amp;amp;px=400" alt="SAIVENKATESH_0-1734296360822.png" title="SAIVENKATESH_0-1734296360822.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;then use Lookup Records and filter based upon the conditions you needed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then use the Action "send Email&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAIVENKATESH_1-1734296529637.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/407799i0180B9EA88CE4F4F/image-size/medium?v=v2&amp;amp;px=400" alt="SAIVENKATESH_1-1734296529637.png" title="SAIVENKATESH_1-1734296529637.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any questions, please feel free to ask.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and Regards&lt;/P&gt;
&lt;P&gt;Sai Venkatesh&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2024 21:02:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3127984#M13303</guid>
      <dc:creator>SAI VENKATESH</dc:creator>
      <dc:date>2024-12-15T21:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128139#M13305</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/259626"&gt;@niveditakumari&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;If you still wish to go with the scheduled job itself, please find the below script:&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;Scheduled Job:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var gr = new GlideRecord("sys_user");
//gr.addActiveQuery();
gr.addQuery("active=true^u_date_of_joiningISNOTEMPTY");
gr.query();
while (gr.next()) {
    var jdate = gr.u_date_of_joining.toString();
    var to_date = new GlideDateTime();//current day's date
    var jday = jdate.split("-")[2]; //joining date
	var jmonth=jdate.split("-")[1]; //joining month
	if(to_date.getMonth().toString()==jmonth &amp;amp;&amp;amp;to_date.getDayOfMonth().toString()==jday){
		gs.eventQueue("joining.notification",gr,gr.name.toString(),gr.email.toString());
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Attached are the screenshots of the event logs that got triggered depending upon the joining dates of the user stored in user table.&lt;BR /&gt;&lt;BR /&gt;This code is tested and works fine for me, So please do give it a try.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please mark this solution as "&lt;STRONG&gt;Helpful&lt;/STRONG&gt;" and "&lt;STRONG&gt;Accepted Solution&lt;/STRONG&gt;" if this solution helped you in any way.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks and Regards,&amp;nbsp;&lt;BR /&gt;K. Sai Charan&lt;BR /&gt;Sr. ServiceNow Developer&lt;BR /&gt;Deloitte India&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 05:18:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128139#M13305</guid>
      <dc:creator>Sai_Charan_K</dc:creator>
      <dc:date>2024-12-16T05:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128145#M13306</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/259626"&gt;@niveditakumari&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you don't need to do this much string manipulation to get the month and day&lt;/P&gt;
&lt;P&gt;simply use filter condition like this&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var c = 0;
var gr = new GlideRecord('sys_user');
gr.addEncodedQuery('active=true^u_hr_hire_dateONToday@javascript&amp;amp;colon;gs.beginningOfToday()@javascript&amp;amp;colon;gs.endOfToday()');
gr.query();
while (gr.next()) {
    c++;
    gs.eventQueue('sn_hr_core.work.anniversary.notification', gr, '', gr.name);
}
gs.print('count is' + c);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 05:28:19 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128145#M13306</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2024-12-16T05:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128197#M13307</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please make me understand that line&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;gr.addEncodedQuery('active=true^u_hr_hire_dateONToday@javascript&amp;amp;colon;gs.beginningOfToday()@javascript&amp;amp;colon;gs.endOfToday()');&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;What this complete script is doing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nivedita&amp;nbsp;&lt;/P&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, 16 Dec 2024 06:42:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128197#M13307</guid>
      <dc:creator>niveditakumari</dc:creator>
      <dc:date>2024-12-16T06:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128202#M13308</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/259626"&gt;@niveditakumari&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;change will be required in above script&lt;/P&gt;
&lt;P&gt;update as this&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var gr = new GlideRecord('sys_user');
gr.addActiveQuery();
gr.addQuery('u_hr_hire_date', 'ISNOTEMPTY');
while (gr.next()) {
    var hireDate = new GlideDateTime(gr.u_hr_hire_date);
    var today = new GlideDateTime();
    if (hireDate.getMonth() == today.getMonth() &amp;amp;&amp;amp; hireDate.getDayOfMonth() == today.getDayOfMonth()) {
        gs.eventQueue('sn_hr_core.work.anniversary.notification', gr, '', gr.name);
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 06:48:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128202#M13308</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2024-12-16T06:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128217#M13310</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/392741"&gt;@Sai_Charan_K&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used yourt code but it is not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find attached screenshot :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notification(When to send)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="niveditakumari_0-1734332480557.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/407873iC14CF3E5B3F6D262/image-size/medium?v=v2&amp;amp;px=400" alt="niveditakumari_0-1734332480557.png" title="niveditakumari_0-1734332480557.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Who will receive&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="niveditakumari_1-1734332613489.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/407874iF36BA44E550AA617/image-size/medium?v=v2&amp;amp;px=400" alt="niveditakumari_1-1734332613489.png" title="niveditakumari_1-1734332613489.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Background Script print&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="niveditakumari_2-1734332843193.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/407875i860D60E843ECFA10/image-size/medium?v=v2&amp;amp;px=400" alt="niveditakumari_2-1734332843193.png" title="niveditakumari_2-1734332843193.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Background Script&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; gr = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;GlideRecord&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"sys_user"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//gr.addActiveQuery();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gr.addQuery(&lt;/SPAN&gt;&lt;SPAN&gt;"active=true^u_hr_hire_dateISNOTEMPTY"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gr.query(); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gs.print(&lt;/SPAN&gt;&lt;SPAN&gt;'hire date is'&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;&lt;SPAN&gt; (gr.next()) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; jdate = gr.u_hr_hire_date.toString();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; to_date = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;GlideDateTime&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;/SPAN&gt;&lt;SPAN&gt;//current day's date&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; jday = jdate.split(&lt;/SPAN&gt;&lt;SPAN&gt;"-"&lt;/SPAN&gt;&lt;SPAN&gt;)[&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;]; &lt;/SPAN&gt;&lt;SPAN&gt;//joining date&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; jmonth=jdate.split(&lt;/SPAN&gt;&lt;SPAN&gt;"-"&lt;/SPAN&gt;&lt;SPAN&gt;)[&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;]; &lt;/SPAN&gt;&lt;SPAN&gt;//joining month&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;((to_date.getMonth().toString()==jmonth) &amp;amp;&amp;amp; (to_date.getDayOfMonth().toString()==jday)){&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.eventQueue(&lt;/SPAN&gt;&lt;SPAN&gt;"sn_hr_core.work.anniversary.notification"&lt;/SPAN&gt;&lt;SPAN&gt;,gr,gr.name.toString(),gr.email.toString()); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.print(&lt;/SPAN&gt;&lt;SPAN&gt;'notification sent to employee'&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Code is not working. It is not checking if condition.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Can you please correct that.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Regards,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Nivedita&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Dec 2024 07:10:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128217#M13310</guid>
      <dc:creator>niveditakumari</dc:creator>
      <dc:date>2024-12-16T07:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128222#M13311</link>
      <description>&lt;P&gt;Can you try printing jday and jmonth values in background script ?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 07:13:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128222#M13311</guid>
      <dc:creator>Sai_Charan_K</dc:creator>
      <dc:date>2024-12-16T07:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128225#M13312</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have written code but it is not working. It is not checking if condition. It is printing hire date is but not printing notification is sent to employee.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="niveditakumari_3-1734333185635.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/407878iFE628076B90A25E2/image-size/medium?v=v2&amp;amp;px=400" alt="niveditakumari_3-1734333185635.png" title="niveditakumari_3-1734333185635.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="niveditakumari_4-1734333311475.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/407879i30D1FE1EDAEB09BA/image-size/medium?v=v2&amp;amp;px=400" alt="niveditakumari_4-1734333311475.png" title="niveditakumari_4-1734333311475.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me to correct code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nivedita&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 07:15:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128225#M13312</guid>
      <dc:creator>niveditakumari</dc:creator>
      <dc:date>2024-12-16T07:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128232#M13313</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/392741"&gt;@Sai_Charan_K&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have printed Jday, Jmonth.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="niveditakumari_0-1734333847873.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/407881iCDC3A45A8F618DBA/image-size/medium?v=v2&amp;amp;px=400" alt="niveditakumari_0-1734333847873.png" title="niveditakumari_0-1734333847873.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nivedita&lt;/P&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, 16 Dec 2024 07:24:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128232#M13313</guid>
      <dc:creator>niveditakumari</dc:creator>
      <dc:date>2024-12-16T07:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128237#M13314</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/259626"&gt;@niveditakumari&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try this&lt;/P&gt;
&lt;P&gt;Also make sure notification and event are on sys_user table&lt;/P&gt;
&lt;P&gt;Is that user having notification preference enabled?&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var gr = new GlideRecord('sys_user');
gr.addActiveQuery();
gr.addQuery('u_hr_hire_date', 'ISNOTEMPTY');
while (gr.next()) {
    var hireDate = new GlideDateTime(gr.u_hr_hire_date);
    var today = new GlideDateTime();
    if (hireDate.getMonth() == today.getMonth() &amp;amp;&amp;amp; hireDate.getDayOfMonth() == today.getDayOfMonth()) {
        gs.eventQueue('sn_hr_core.work.anniversary.notification', gr, gr.email.toString(), gr.getDisplayValue());
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 07:27:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128237#M13314</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2024-12-16T07:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128240#M13315</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/392741"&gt;@Sai_Charan_K&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm printing Jday,Jmonth. It is printing Jmonth correctly but in Jday it is taking day and time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me to correct that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nivedita&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 07:30:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128240#M13315</guid>
      <dc:creator>niveditakumari</dc:creator>
      <dc:date>2024-12-16T07:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128250#M13316</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="niveditakumari_1-1734334891190.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/407884i096DFDFBAC28446C/image-size/medium?v=v2&amp;amp;px=400" alt="niveditakumari_1-1734334891190.png" title="niveditakumari_1-1734334891190.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="niveditakumari_2-1734334927336.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/407887iA7068E86DC9E9452/image-size/medium?v=v2&amp;amp;px=400" alt="niveditakumari_2-1734334927336.png" title="niveditakumari_2-1734334927336.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me to correct that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nivedita&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 07:42:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128250#M13316</guid>
      <dc:creator>niveditakumari</dc:creator>
      <dc:date>2024-12-16T07:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128276#M13318</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help to correct code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nivedita&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 08:07:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128276#M13318</guid>
      <dc:creator>niveditakumari</dc:creator>
      <dc:date>2024-12-16T08:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128279#M13319</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/259626"&gt;@niveditakumari&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Adjusted the code to below as I wasn't aware that your "Date Of Joining" field was not a date field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var gr = new GlideRecord("sys_user");
gr.addQuery("active=true^u_date_of_joiningISNOTEMPTY"); // Query for active users with a joining date
gr.query();

while (gr.next()) {
    var jdate = new GlideDateTime(gr.u_date_of_joining); // Parse u_date_of_joining
    var to_date = new GlideDateTime(); // Current date
	gs.print(jdate.getDayOfMonth());

    // Compare day and month
    if (to_date.getMonthUTC() == jdate.getMonthUTC() &amp;amp;&amp;amp; to_date.getDayOfMonth() == jdate.getDayOfMonth()) {
        gs.print("Hi, it's the user's joining date anniversary!");
        gs.eventQueue("joining.notification", gr, gr.name.toString(), gr.email.toString());
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Please try using this script and let me know if there are any further issues.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please mark this solution as "&lt;STRONG&gt;Helpful&lt;/STRONG&gt;" and "&lt;STRONG&gt;Accepted Solution&lt;/STRONG&gt;" if this solution helped you in any way.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks and Regards,&amp;nbsp;&lt;BR /&gt;K. Sai Charan&lt;BR /&gt;Sr. ServiceNow Developer&lt;BR /&gt;Deloitte India&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 08:37:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128279#M13319</guid>
      <dc:creator>Sai_Charan_K</dc:creator>
      <dc:date>2024-12-16T08:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128328#M13320</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/259626"&gt;@niveditakumari&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;seems the field is empty for the user record&lt;/P&gt;
&lt;P&gt;are you sure the field name is correct?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 09:02:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128328#M13320</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2024-12-16T09:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128349#M13322</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/392741"&gt;@Sai_Charan_K&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for all your help. It is working as expected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is printing correct in background script but when I'm executing that in schedule job manually it is not showing logs with notification subject line in emails and logs in events.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me for that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nivedita A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 09:29:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128349#M13322</guid>
      <dc:creator>niveditakumari</dc:creator>
      <dc:date>2024-12-16T09:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128393#M13325</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/259626"&gt;@niveditakumari&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;I think this is because of the cross scope privileges issues.&lt;/P&gt;&lt;P&gt;Did you try checking the giving the cross scope privileges? If not please do as you are access global scope data from HR scope. Please go to the table :&amp;nbsp;sys_scope_privilege.LIST and check for the record with your schedule job name or create a new record under this table to allow the access.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please mark this solution as "&lt;STRONG&gt;Helpful&lt;/STRONG&gt;" and &lt;SPAN&gt;please mark it "&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;STRONG&gt;orrect"&lt;/STRONG&gt; and close the thread so that it benefits future readers&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks and Regards,&amp;nbsp;&lt;BR /&gt;K. Sai Charan&lt;BR /&gt;Sr. ServiceNow Developer&lt;BR /&gt;Deloitte India&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 09:58:12 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128393#M13325</guid>
      <dc:creator>Sai_Charan_K</dc:creator>
      <dc:date>2024-12-16T09:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128435#M13326</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/392741"&gt;@Sai_Charan_K&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I create notification and schedule job in global scope as I'm accessing global data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please confirm on that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nivedita&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 10:24:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128435#M13326</guid>
      <dc:creator>niveditakumari</dc:creator>
      <dc:date>2024-12-16T10:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: I need to send notification on employee work anniversary.</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128523#M13327</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/392741"&gt;@Sai_Charan_K&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I create notification and schedule job in global scope.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please confirm on that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nivedita&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 11:41:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/i-need-to-send-notification-on-employee-work-anniversary/m-p/3128523#M13327</guid>
      <dc:creator>niveditakumari</dc:creator>
      <dc:date>2024-12-16T11:41:26Z</dc:date>
    </item>
  </channel>
</rss>

