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.
The same Approval reference/ links are referenced on all of the notifications - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • The same Approval reference/ links are referenced on all of the notifications
KB0689619

The same Approval reference/ links are referenced on all of the notifications


905 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

Symptoms


A Scheduled Job "Approval Reminder Notification" that queries the Approvals that are still at Requested State. From there it generates an event "catalog_task_approval_reminder" that triggers a Notification "Pending Approvals Reminder".

On that Pending Approvals Reminder notification there are the following links/references....

Hello ${approver},

Approval for: ${sysapproval}

View the ${sysapproval.sys_class_name}: ${sysapproval.URI_REF}
View the Approval Request: ${URI_REF}

Request: ${sysapproval.number}

Release


Jakarta Patch 8a

Cause


Found that the original script for the Scheduled Job "Approval Reminder Notification" would iterate through the Approvers via the while loop but there was no 'gr.next' within the for loop to iterate and return the other glide records information. It would pull the first glide record and then just reuse it for the rest of the notifications

Resolution


Moving the return section of the for loop into the while loop would return the gr of each requested approval. Which in turn simplified the coding, see the code we used below; 

var arrUtil = new ArrayUtil(); //set up array to find all pending approvals for users 


var gr = new GlideRecord('sysapproval_approver'); 
gr.addQuery('state', 'requested'); 
gr.addQuery('sysapproval.source_table','sc_req_item'); 
gr.orderBy('approver'); 
gr.query(); 

while (gr.next()) { 

gs.eventQueue('catalog_task_approval_reminder', gr, gr.approver.sys_id); 
} 

 


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.