Add copy of email notification (from additional comments) to Activity Log on RITM

Chris Dea1
Tera Contributor

Hi all,

Newbie ServiceNow admin here :).  I hope someone can tell me how this can be done... Recently I received a request to improve what IT staff see in Activities in relation to email notifications when working on Tasks.    Currently, when an additional comment is added to an Incident, "System" adds a copy of the email to "Activity", see screenshot below.  Our ITIL users have grown accustomed to seeing that on incidents and they like it since it assures them that an email was sent to the customer after the comment was added...

find_real_file.png

Now they would like to see the same thing for "Activity" area on the "Requested Item Notes" tab we have on Tasks.  See screenshot below.  You can see a "Test" comment was added but there is no "log" from "System" added showing a copy of the email send to the customer.  What IT staff want to see if the comment and then a log from "System" showing a copy of the email notification - like what is currently setup with incidents.  I have verified in the system logs that email notifications are indeed sent out, the need is for the "log" or copy of the email notification to show on the Requested Items Notes....

 

find_real_file.png

Since our instance is pretty close to OOTB I assume this is the default way things are set up.  If someone could tell me how I would have the "system" log of the email notification after an additional comment is added to Requested Item Notes I would greatly appreciate it!

Thanks in advance!

-Chris

1 ACCEPTED SOLUTION

If you want to use a related list for showing email please follow this - 

The sys_email table uses a Document ID field(s) to relate back to records, not a direct relationship.   So you will need to create a user defined related list:

 

Creating Defined Related Lists - ServiceNow Wiki

 

1. Go to System Definition\Relationships and click New

2. Name what you want to call this related list in the Name field- example "Email Log"

3. In applies to table choose Catalog Task 

4. In queries from table choose Email

5. In the query with script field, paste in:

(function refineQuery(current, parent) {

current.addQuery("target_table", parent.request_item.sys_class_name);

current.addQuery("instance", parent.request_item.sys_id);

})(current, parent);

6. Click Submit.

 

7. Go to your Catalog Task form, configure related lists, and add "Email Log" or whatever you called the relationship in step 2 above.

find_real_file.png

 

If this has answered your question please Mark Answer/Helpful.

 

Thanks

Sonali

View solution in original post

10 REPLIES 10

Hi You want the email of RITM to show on catalog task for that you would need to trigger the notifications on the catalog task table. You can have a custom worknotes added in the catalog task that email was sent to so and so after the additional comments are added but they wont be in the format as it shows on RITM.

If you check the emails on the email log it will show the target as RITM record so if you would want to copy one can use that and add the target as catlog task number but it won't show in activity log unless it is sent.And you would never want to sent duplicate emails to same receipents. So scriptwise you can make it happen but it won't be something business would like about receiving dup emails.

 

Alternatively one can try to create a relationship which will show as a related list on the catalog task record and that can show the email logs. I havent tried this but this is something we can make it work. Let me know if this has answered your question.

If you want to use a related list for showing email please follow this - 

The sys_email table uses a Document ID field(s) to relate back to records, not a direct relationship.   So you will need to create a user defined related list:

 

Creating Defined Related Lists - ServiceNow Wiki

 

1. Go to System Definition\Relationships and click New

2. Name what you want to call this related list in the Name field- example "Email Log"

3. In applies to table choose Catalog Task 

4. In queries from table choose Email

5. In the query with script field, paste in:

(function refineQuery(current, parent) {

current.addQuery("target_table", parent.request_item.sys_class_name);

current.addQuery("instance", parent.request_item.sys_id);

})(current, parent);

6. Click Submit.

 

7. Go to your Catalog Task form, configure related lists, and add "Email Log" or whatever you called the relationship in step 2 above.

find_real_file.png

 

If this has answered your question please Mark Answer/Helpful.

 

Thanks

Sonali

Thanks Sonali!  I am going to try this out and create the related list to show the emails on the Task.  I will let you know how it works out.

Thank you Sonali, I believe this will meet my IT staff needs for now.  Now they can see email log on the related list if they choose to.  Marked your reply above as correct answer.

Hi Chris! 

 

Newbie admin here as well 😀. I'm trying the same recommendation from Sonali. I can't seem to get the new relationship to show within the related list for the SCTASK. Is there any additional information that needs to be added to the script that was provided? I did a copy and past as noted, with not luck. Thank you for any feedback.