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

sieusaopolo15
Tera Guru

In the while () condition try:

while (gr.next()) {
  gs.eventQueue("remove.license", gr);
}

Community Alums
Not applicable

Hello @sieusaopolo15 

Still not working

Hi @Community Alums ,

Then I think the issue here is your notifications, can you share us the notification settings like send to users with parm1 or parm2 like in this attachment ?

sieusaopolo15_0-1715587019109.png

 

Community Alums
Not applicable

Hello @sieusaopolo15 

Here's the attached image