Report on Incidents with no Additional Comments

Russell Abbott
Kilo Sage

I have built a database view to join Incident and sys_journal tables. So i can report on this and see journal entries entered to each INC number.

How can i report on this DB view, to show all Incidents which have not had an Additional Comment within x number of days?

Can this be done in report builder or am I going to want to look at PA?

Thanks

1 ACCEPTED SOLUTION
3 REPLIES 3

Saiganeshraja
Mega Sage

Refer Here

Russell Abbott
Kilo Sage

@Ankur Bawiskar  Thanks! I used a modified version of what you linked to. I created a new date/time field on the INC table, and a new BR to populate that field. BR is below

(function executeRule(current, previous /*null when async*/) {
	
	current.u_last_customer_update = gs.nowDateTime();
	
})(current, previous);

I can query off of that field. which is great going forward, but I understand I would need to create a fix script to populate that field for all existing INC's, marking the date of the most recent Customer Comment. Is that something you have some familiarity with?

Fix script below, I'm unsure of how to draw the date from the most recent comment

var incGR=new GlideRecord('incident');
incGR.addEncodedQuery('active=true^u_last_customer_updateISEMPTY');
incGR.query();
while(incGR.next()){
	incGR.u_last_customer_update=incGR.comments.created;
	incGR.update();
}