Event in Queue State not Processing

Toms V
Giga Contributor

I have a custom field "U_scheduled_date" in customer Service case table. I   need to create an event that needs to be fired before 3 minutes of the date time value in the custom field. I have created an event that is currently being queued but the event always stays in ready state and its not processing. Below is the code i used

var gr = new GlideRecord('sn_customerservice_case');

gr.addQuery('sys_id',current.sys_id);

gr.query();

if(gr.hasNext())

        {

                while (gr.next())

                        {

                              var newdate=   current.u_scheduled_date.getDisplayValue();

                              var gdt = new GlideDateTime();

                              gdt.setValue(newdate);    

                              gdt.addSeconds(-180);

                              gs.eventQueue("sn_customerservice.DOB_Update_Case_Sched", gr,   gs.getUserID(), gs.getUserName(),gdt);

                        }

        }

find_real_file.png

Any idea whats the issue here is? Can any of you guys help please?

Thanks,

Tom

1 ACCEPTED SOLUTION

Hi Berny,



I didn't say this is a constraint. If you look at Toms post you will see that gs.eventQueue is under this form:



gs.eventQueue("sn_customerservice.DOB_Update_Case_Sched", gr,   gs.getUserID(), gs.getUserName(),gdt);



The function call is done with 5 parameters out of which last argument value is a date object rather than a queue name. In his screenshot you can see queue contains a date rather than either being empty or containing a specific queue.


Here:



https://developer.servicenow.com/app.do#!/training/article/app_store_learnv2_automatingapps_jakarta_...



Hope this clarifies your question.


View solution in original post

19 REPLIES 19

Ahh!! Good catch. Indeed. That last argument passed in as gdt shouldn't be considered a "third parameter" been passed in. Instead it could be passed as a parameter instead of the user name.



Something like this:



gs.eventQueue("sn_customerservice.DOB_Update_Case_Sched", gr,   gs.getUserID(), gdt);


Thanks,


Berny


Thanks Sergiu. The issue is fixed now


Toms V
Giga Contributor

Thanks everyone. Its fixed now



Thanks,


Tom


sowmyab
Giga Contributor

Facing the same issue still ... Queue field is empty....


once executed the list of event are not processed and the state always stay as "ready"


Can you please help me out what will be the issue?


Queue field is empty for all events that use the regular "events process" job. For other type of events, like text index one which have their own job, the queue will be populated with the defined queue for that job.


So, you mean in your case events are not being picked up by the events process job?