Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Reject comments not displayed in email notification for Knowledge article or any table record with approval - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Reject comments not displayed in email notification for Knowledge article or any table record with approval
KB0786276

Reject comments not displayed in email notification for Knowledge article or any table record with approval


2634 Views Last updated : Apr 30, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

When a request is submitted for approval and once is approved at first and then it goes to 2nd level approval and when the 2nd level approver rejects the target record the email is triggered but the rejection comments are unavailable to be included in the notification. This works fine when the first level approver rejects the article.

Resolution

[Most Probable Cause:


The filter of the notification script does not seem correct as it is returning many records and using the first one which could be a random record:


Solution
Check your filter according to your business needs. As This is a customisation, we cannot exactly how it show work but it seems to me that you can add possibly the condition to exclude "No Longer required" approvals:

You can test as a background script to make sure it will work. Additionally, remember that if the notification depends on an event, it has to be triggered not before the rejection.
var pd = new GlideRecord('sysapproval_approver');
pd.addQuery('source_table', 'kb_knowledge'); //kb_knowledge could be replaced by any table
pd.addQuery('document_id',"SYS_ID_OF_THE_REJECTED_RECORD");
pd.addQuery('state','rejected');
pd.orderByDesc('sys_updated_on');
pd.query();
if(pd.next()) {
var notes = pd.comments.getJournalEntry(-1);
var na = notes.split("\n\n"); //stores each entry into an array of strings
for (var i = 0; i < na.length; i++) {
 gs.print(na[1]);
}
}



Recommendation:

Always check in sub-production instances to validate if that the filter is correct, test different scenarios before moving into production. You can use background scripts as stated before

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.