Additional Comments Field Background colour

Shital18
Giga Contributor

Hi,

when creating a new incident ticket i i want the additional comments field to show in red to denote that this field will send an email to the caller.

I managed to work out that you can do this via field styles which works great, however i found a drawback, when my instance sends an email out using the Incident commented via ESS it shows the 3 most recent additional comments (which is fine, however the background of those comments is also red which i do not want, I want the background to always be white.

 

If i remove the field style on the tasks table > Additional Comments field then the notification is fine but then the field is no longer red when the incident form loads.

is there a way to achieve either of the following please?

1. can i reimplement the additional comments field style on the task table and somehow amend my email notification script to remove the red background? - here is my mail script - its very simply, it simply gets the last 3 comments as determined by the system property for Email Notifications.

(function runMailScript(current, template, email, email_action, event) {
template.print(gs.getMessage('${comments}'));
})(current, template, email, email_action, event);

 

OR 2. i dont touch the field style for the additional comments field, but is there a way upon loading the incident form that the additional comments field is red? - by default when a new form is loaded the field has no colour to it. i have also looked at the glide ui properties via sys_properties.list but none of that helps me.

 

I am hoping someone here can help me.

 

Thank you.

 

 

1 ACCEPTED SOLUTION

There is another way to handle this .You just need to update your Email script as below and works :

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
    /* Optional EmailOutbound */
    email, /* Optional GlideRecord */ email_action,
    /* Optional GlideRecord */
    event) {

    // Add your code here
	var arr = [];
    var gr = new GlideRecord('sys_journal_field');
    gr.addQuery('element_id', 'ed92e8d173d023002728660c4cf6a7bc');
    gr.addQuery('name', 'incident');
    gr.addQuery('element', 'comments');
	gr.setLimit(3);
    gr.query();
    while (gr.next()) {
        arr.push(gr.value.toString());
    }
	
		template.print(arr);
	
	


})(current, template, email, email_action, event);

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

5 REPLIES 5

Hi,

If your query is resolved, please mark the answer as correct and close this thread for others.


Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke