The scheduled job wont fire the event.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2024 07:59 PM - edited 05-12-2024 08:01 PM
Hello,
I want to send notification to the users have the specific roles and las login time 30 days ago but my schedule job wont fire the event and won't send the notification to the users, did i missed something or my process is wrong i need help for this, thank you in advance.
Please see the attached images for reference.
Scheduled Job Script
var gr = new GlideRecord('sys_user_has_role');
gr.addEncodedQuery('user.last_login_timeRELATIVELT@dayofweek@ago@30^role.nameINchange_manager,sn_change_write,sn_chg_soc.change_soc_admin,sn_customerservice.consumer_agent,sn_customerservice.contact_manager,sn_customerservice_agent,sn_customerservice_manager,sn_esm_admin,sn_esm_agent,sn_lookup_verify_user,sn_majorissue_mgt.major_issue_manager,admin,catalog,catalog_admin,catalog_lookup_admin,flow_designer,import_scheduler,knowledge,knowledge_manager,search_application_admin,security_admin,sn_ace.ace_user,sn_hr_sp.admin,sn_hr_sp.esc_admin,teamdev_code_reviewer,itil,sn_incident_write,problem_coordinator,problem_manager,problem_task_analyst,sn_problem_write,sn_request_write');
gr.query();
while (gr.next) {
gs.eventQueue("remove.license", gr);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2024 08:29 PM
@Community Alums
You are missing () after next, Please use while(gr.next())
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2024 12:32 AM
Hello @Maddysunil
Still not working