Power Automate query incident tickets being handled within the last 24 hours using ServiceNow API

makku22
Tera Contributor

Hi Everyone,
I have a slight similar to this case, but in my case I'm using Service Now API through Power Automate (as connector) and i just want to query the incident tickets being handled within the last 24 hours.


https://www.servicenow.com/community/itsm-forum/way-to-show-incidents-with-no-update-within-24-hours...


In the Query section in Service Now connector List Record action, I used assignment_group=12345dsftyrgh3454^system_updated_on>=javascript:gs.hours(24). These two combined queries didn't return any data, but if I test them individually/separately it works. By the way, this service Id that we used in Service Now API is a read only account, not sure if that's the cause. Could someone guide me the right direction?

6 REPLIES 6

Karthick9
Tera Contributor

Hi Please try the below query and see if it works

 

assignment_group=sys_id_of_group^sys_updated_onRELATIVELT@hour@ago@24.

Thanks for the response, Karthick9. I just tried your suggestion above. It generate a data now,it generate tickets assigned on the correct group, but it includes tickets that are last updated a month ago (like from March 15,2023). It's so weird ServiceNow generates irrelevant to our queries.

can you share the query you tried ?

I'm sorry i cannot provide the exact/actual query i used due to company's policy, but I follow your suggestion above. I replaced sys_id_of_group with our assigment group unique id.

 

assignment_group=sys_id_of_group^sys_updated_onRELATIVELT@hour@ago@24