When Priority changes highlight with color in Activity Log of Incident.

Aac
Kilo Contributor

Hi Team,

I want to highlight color in the Activity log of the Incident when the Priority changes.

In this image I want the side grey bar to be red on Field change(whenever Priority is updated). Or the whole background of this Activity to be red.

I have tried the below in System Properties:

Still it is not working. Please suggest some solution.

Basically I want to highlight in the Activity log with some color whenever Priority changes.

My instance is Kingston.

 

Thanks in Advance.

Aac

 

1 ACCEPTED SOLUTION

Are you OK with priority being BOLD RED? Because getting the background requires more DOM/CSS coding.

use 

cell.style.cssText = "color: red;font-weight: bold;";

//instead of

//cell.style.cssText = "background-color: red";

find_real_file.png

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

View solution in original post

9 REPLIES 9

Mike Allen
Mega Sage

If you look here, the value is jsut gold, not the css style:

 

find_real_file.png

So, try just 'red'.

Aac
Kilo Contributor

Hi Mike,

Setting this property with only 'Gold' as value is also not working. Do we call the new system property created from somewhere? If yes ,can you suggest from where we can call this property. Because I think every property is called from some script or somewhere. And that may be the reason our newly created property is not getting triggered.

 

Thanks

Aac

vkachineni
Kilo Sage
Kilo Sage

I would first try with the system property as Allen suggested.

As a work around you could do some DOM manipulation

Type onLoad

Isolate script : unchecked

UI type: all

function onLoad()
{
//alert('hi on load');
var fieldsList = document.getElementsByClassName("sn-widget-list-table-cell");
for(var i=0; i<= fieldsList.length-1; i++)
{
var cell = fieldsList[i];
//console.log("cell = " + cell.innerText);
if(cell.innerText == 'Priority')
{
var nextCell = fieldsList[i + 1];
if(nextCell)
{
if(nextCell.innerText.indexOf("was") !== -1)
{
//console.log("Found the priority change cell");
cell.style.cssText = "background-color: red";
console.log("color changed to red");
}
}
}
}

}

find_real_file.png

 

 

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

Aac
Kilo Contributor

Hi Kachineni,

 

Where do you suggest to write this script? Dis you want to mention Client script? If yes then which table should be selected? Incident table?

And where is this Isolated script:unchecked present?

 

Thanks

Aac