Event in stuck state - 'Ready state'

Pravitha
Tera Contributor

Why the event is in READY state, not going to the PROCESSED state ?

Please comment on this.

3 REPLIES 3

Manik
ServiceNow Employee
ServiceNow Employee

Hi Pravitha,

Can you please share the code how the event was triggered? This can be due to a wrong value being passed in the queue argument of gs.eventQueue method.

Thanks,

Manik

 

 

Pravitha
Tera Contributor

Hi Manik,

Thanks for the reply !

 

Event fires when a scheduled job has been failed.

Table : sys_trigger

I have written the code for the scheduled job :

var check = new GlideRecord ('sys_trigger');
check.addEncodedQuery('sys_created_onBETWEENjavascript:gs.beginningOfYesterday()@javascript:gs.endOfToday()^state=-1');
check.query();
while (check.next())
{
gs.eventQueue('scheduledjob.failed',check);
}

Please check and advise..

Pratyusha
ServiceNow Employee
ServiceNow Employee

Hello Pravitha,

I tried with your code in a similar way as follows - 

Here is the script I am using - 

var check = new GlideRecord ('incident');
check.addQuery('short_description', 'CONTAINS', 'Test Incident');
check.query();


while(check.next()) {
    gs.eventQueue('testincident.found', check);
}

 

And the event registration is as follows -

find_real_file.png

 

So, when I ran the above code, an event was generated and is in processed state itself - 

find_real_file.png

Can you please check once again? Is the event getting generated but remains in ready state or is not generated at all?

 

Thanks,

Pratyusha