Need help formatting comments field in email notification

purple123
Kilo Explorer

I want my email notification to customers to be easy to read just like first example.   Currently in my environment, the email includes the email threads which makes it hard to read.   How can I get rid of the thread part (Please see the emails in blue where I strike through the email parts)?   Please advise.   Thanks.   Diane

 

Example when I open a ticket with ServiceNow Support (hi.service-now.com):

1. I reports an incident.   Types in short description and steps to reproduce.

2. I get an email saying an incident is opened on my behalf.

Reading email in my Outlook, I see Email 1:

 

INC#: short description

----------------------------------------------------------------------------

my reproducible steps that I wrote (1, 2, 3.)             notes

 

3. Support representative writes back saying "thank you. I'll look into it, etc."

Email 2:

 

INC#: short description

----------------------------------------------------------------------------

thank you. I'll look into it, etc.                                                 notes

----------------------------------------------------------------------------

my reproducible steps that I wrote (1, 2, 3.)         notes

 

4.   I responded to email, "By the way, it's happening in PROD too."

Email 3:

 

INC#: short description

----------------------------------------------------------------------------

By the way, it's happening in PROD too               notes

----------------------------------------------------------------------------

thank you. I'll look into it, etc.                                             notes

----------------------------------------------------------------------------

my reproducible steps that I wrote (1, 2, 3.)     notes

 

 

Example what my 3 email notifications look like In my environment:

Email 1:

INC#: short description

----------------------------------------------------------------------------

my reproducible steps that I wrote (1, 2, 3.)             notes

 

 

Email 2:

INC#: short description

----------------------------------------------------------------------------

thank you. I'll look into it, etc.                                             notes

 

From: IT Service Desk

Sent: blah

My reproducible steps that I wrote (1,2,3)

----------------------------------------------------------------------------

my reproducible steps that I wrote (1, 2, 3.)         notes

 

 

Email 3:

INC#: short description

----------------------------------------------------------------------------

By the way, it's happening in PROD too               notes

 

From: IT Service Desk

Sent: blah

thank you. I'll look into it, etc.          

 

From: IT Service Desk

Sent: blah

My reproducible steps that I wrote (1,2,3)

----------------------------------------------------------------------------

thank you. I'll look into it, etc.                                             notes


From: IT Service Desk

Sent: blah

My reproducible steps that I wrote (1,2,3)

----------------------------------------------------------------------------

my reproducible steps that I wrote (1, 2, 3.)     notes

1 ACCEPTED SOLUTION

cbailey1
Mega Contributor

I'd agree with this and Terri's response above.   It seems like if the e-mail header information is written to the comments on your incident ticket, you definitely have something going on in the Inbound E-mail Actions for the incident table.   Out of the box there is typically a "Create Incident" and an "Update Incident" action. (Check under "System Policy" -> "Email" -> "Inbound Actions" if you're not familiar.)   You may want to post the contents of one or both of those rules if you're still having trouble, as I'm sure someone here will be able to give you a fix pretty quickly.



If you haven't customized those rules yet, chances are that you'll find a line or two about:



current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;




Change that line to something more like:



current.comments = "email.body_text"




The "received from: " + email.origemail" is very likely the part giving you the lines you don't want.   In case you want to customize the action in some other way once you start looking at it, check the Wiki article on Inbound Email Actions: Inbound Email Actions - ServiceNow Wiki




As always, take this with a grain of salt and test this first before just implementing in production.


View solution in original post

7 REPLIES 7

She Sull
Giga Guru

Hi Diane,



It sounds like you have the Notify feature on.   You should be able to control those settings by navigating here: Notify > Administration > Properties



Hope that helps.



- Sherry



Notify - ServiceNow Wiki


Administering Notify - ServiceNow Wiki


purple123
Kilo Explorer

Thank you Sherry for your reply.   I am not using Notfiy.   I am using what comes with ServiceNow which is Email Notification templates.  



In the Message part of the email template, I have the following:



${URI_REF}: ${short_description}


${comments}


ohhgr
Kilo Sage
Kilo Sage

Hi Diane,



From the above example it seems that you just want latest comment to be displayed in the mail.



Could you check the system property "glide.email.journal.lines" in your instance. You can set it to the number of entries that should be pulled, by default it's 3.



Hope that helps.



More details here Using Journal Fields - ServiceNow Wiki



Thanks,
Mandar


Thanks Mandar for your response.   I don't want just the last comment.   I want all the comments.   I just don't want "comments with the comment" part in each comment.