The scheduled job wont fire the event.

Community Alums
Not applicable

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);

}

 

6 REPLIES 6

Maddysunil
Kilo Sage

@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

Community Alums
Not applicable

Hello @Maddysunil 
Still not working