- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2019 08:18 AM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2019 08:23 AM
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";
Vinod Kumar Kachineni
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2019 06:08 AM
Please use DOM manipulation as a last resort.
That was a client script onLoad on the incident table.
If on madrid set Isolate script : unchecked
You can add it to your list view by hitting the gear icon.
Vinod Kumar Kachineni
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2019 07:54 AM
Hi Kachineni,
It worked. Thanks. But the highlight is quite long. I want it to cover only the Priority word. Can you suggest on this??
Thanks
Aac
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2019 08:23 AM
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";
Vinod Kumar Kachineni
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2019 09:08 AM
//Here is the red background with white text
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)
{
cell.innerHTML = "<span style='background-color: red; color: white;'>" + cell.innerHTML + "</span>";
//console.log("Found the priority change cell");
//cell.style.cssText = "background-color: red";
//cell.style.cssText = "color: red;font-weight: bold;";
console.log("color changed to red");
}
}
}
}
}
Mark Correct if this solves your issue.
Vinod Kumar Kachineni
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2019 02:27 AM
Hi Kachineni,
Thanks for the code. It worked. I needed another help.
Each OOB System Property present in the sys_properties table is called from somewhere. I wanted to know from where 'glide.ui.activity_stream.style.work_notes' property is called. This property is used to define the color in activity log for worknotes.
I wanted to know this as I need to do some modification on that code. The requirement is as below:
Each entry in the work notes will be highlighted by a color that represents the priority of the incident at the time of the entry.
So if the incident is a P4, every time I enter work notes, they will have a green bar (for example), until the priority changes
If the incident is a P3, every time I enter work notes, they will have a blue bar (for example) , until the priority changes
If the incident is a P2, every time I enter work notes, they will have a yellow bar (for example) , until the priority changes
If the incident is a P1, every time I enter work notes, they will have a red bar (for example) , until the priority changes
Here is how I would visualize it:
Please suggest.
Thanks
Aac