How to give red color to opened by field of incident when opened by time become more than 48 hours?

sruthig
Tera Expert

There is one requirement on incident list view. When incident opened time become more than 48 hours, Opened field should become red in color on load of form list view. How to achieve this?

1 REPLY 1

Mahesh23
Mega Sage

Hello,

Create new script include with below code and field style in sys_ui_style table and try

 

 var grScReqItem = new GlideRecord('sc_req_item');
        grScReqItem.addEncodedQuery("opened_atRELATIVELT@hour@ago@48");
        grScReqItem.orderByDesc('sys_created_on');
        grScReqItem.query();
        if (grScReqItem.next()) {
            return true;
        }
		return false;

 

 

Mahesh23_0-1666946998319.png

 

Mahesh23_1-1666947022439.png