Schedule job event not being processed

pablor
Kilo Expert

I have created a scheduled job to keep the track of priority two incidents that are currently in waiting feedback status and last update was 3 days ago.

But once executed the list of event are not processed and the state always stay as ready. Could somebody explain me what is wrong? The purpose is create a notification. Many thanks in advance

var looking = new GlideRecord('incident');
looking.addQuery('active', true);
looking.addQuery('priority', '2');
looking.addQuery('incident_state', '=', '-10');
looking.addQuery('sys_updated_on', '<', gs.daysAgo(3));
looking.query();     // Issue the query to the database to get relevant records
            while (looking.next()) {
                        gs.eventQueue('incident.p2inactivity',looking,looking.u_owner,looking.number);
                }

Bellow the event log summary:

p2incident.jpg

p22.jpg

p23.png

1 ACCEPTED SOLUTION

pablor
Kilo Expert

Hi,



Is working perfectly fine now. The problem was caused by the event definition.


When I created the new event I set up the Queue field to value '100', which was causing the event to not be grabbed by the event process.


View solution in original post

10 REPLIES 10

saritha9
Giga Expert

If I understand correctly, Scheduled job is creating the event but the event is not processed right.



Are you sending notification to correct users?


p25.jpgYes, the scheduled job is creating the event as shown in the pictures, but is not being processed.


The first step in order to send the notification is that the event status is processed.


1. ) Scheduled job creates the event.


2.) Based on that event, the notification is send.



Anyway here you have the notification picture:


p24.jpg


kiley
Giga Contributor

I am guessing you want to send these incident reports to the owner of the job, and it seems like the log summary does not show any values for the User ID and User Name. Could this be causing the code to break?


Hi Kiley,



Yes, the idea is that the owner of the incident gets the notification. First parameter stands fo owner sys_id.


That's correct as incident.inactivity that comes by default shows that kind of numbers as well



Regards