Add scripting to conditions of report

Shane18
Kilo Expert

Hi,

I'm trying to add scripting to a report that I am creating, but I'm having some trouble and can't figure out how to do this. What I'm trying to achieve is the following: I want to show incidents that have not been updated within the last 24 hours. However, I do not want to include the weekends in this 24-hour count. I could do this by scripting - I just don't know how to add scripting to the conditions of a report.

Any help appreciated, thanks!

1 ACCEPTED SOLUTION

dvp
Mega Sage
Mega Sage

You can call a scriptinclude  in report condition

 

do the following

  1. create a client callable script include

 

function inci(id){
	
	
	var gr = new GlideRecord('core_company');
	gr.addQuery('u_services', 'IN', id);
	gr.query();
	
	var arr = [];
	
	while(gr.next()){
		
		arr.push(gr.sys_id.toString());
	}
	
	return arr;
	
}

 

2. Call the script in the report as shown in the below image

 

 

For your use case what you can do is return the incidents that fall under 24hr bucket and use the condition as sysID is one of

View solution in original post

10 REPLIES 10

Shaun19
Kilo Contributor

Awesome. Thanks for posting the working script.