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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

check this out

https://community.servicenow.com/community?id=community_blog&sys_id=37c045cadbcf409023f4a345ca961921

https://community.servicenow.com/community?id=community_blog&sys_id=0740de96dbcf889023f4a345ca96195d

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Saiganeshraja
Kilo Sage
Kilo Sage

Refer Here

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

check this out

https://community.servicenow.com/community?id=community_blog&sys_id=37c045cadbcf409023f4a345ca961921

https://community.servicenow.com/community?id=community_blog&sys_id=0740de96dbcf889023f4a345ca96195d

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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();
}