Send notification once at 30 days and 60 days
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 09:05 AM
Hi,
I am not sure I am putting this in the right forum but hope someone can assist.
I have created 2 notifications to send to ITIL users that have not logged in for over 30 days and 60 days.
Scenario 1:
ITIL user has not logged in for over 30 days
Event: Last.login
Notification: ITIL users not logged in for over 30 day
- Send When: Event is fired
Scheduled job: Send ITIL not logged in for 30 days
- var gr = new GlideRecord('sys_user');
gr.addEncodedQuery('roles=ITIL^active=true^last_login<javascript:gs.beginningOfLast30Days()^ORlast_loginISEMPTY');
gr.query();
while(gr.next()){
gs.eventQueue("Last.login", gr);
}
- var gr = new GlideRecord('sys_user');
- Job runs daily
- Issue: Some users are getting the email notification every day and I only need it to send to them once
Scenario 2:
ITIL Users not logged in for over 60 days
Created in Dev:
Event: Last.login60
Notification: ITIL users not logged in for over 60 day
- Send when: Event is fired
Scheduled job: Send ITIL not logged in for 60 days
- var gr = new GlideRecord('sys_user');
gr.addEncodedQuery('roles=ITIL^active=true^last_login<javascript:gs.beginningOfLast60Days()^ORlast_loginISEMPTY');
gr.query();
while(gr.next()){
gs.eventQueue("Last.login60", gr);
}
- var gr = new GlideRecord('sys_user');
- Job runs daily
- Issue: Some users are getting the email notification every day and I only need it to send to them once
I would appreciate any assistance on how to have the job run daily but only send the notification to the user once.
Thanks,
Gina
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 06:21 AM
@Bridgina Starr if this solved your issue please mark the response as helpful and please accept the solution so that others can benefit from the content , thank you 😊.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2023 10:50 AM
Hi,
I appreciate your input. I have tried this, and it is not working. I think it may have something to do with "gr.user.email_id" but don't know for sure. I am working with another developer, but we have been quite busy and have not gotten a chance to back to this. I also just noticed that you have "contains" in your script but ours has like so I am going to go back and try that and see. I will keep you updated, and I am sorry for the delay.
Thanks,
Gina