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.
ATF: How to find the second approval for a request item RITM - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • ATF: How to find the second approval for a request item RITM
KB0787358

ATF: How to find the second approval for a request item RITM


5276 Views Last updated : Apr 8, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

Your automated test framework Record Query step needs to find the second approver for a request item.  What series of steps will enable you to find the second approver and approve the request item?

Cause

There is no out-of-box ATF test that explains how to search for the second approver, impersonate that approver, open the approval form, and approve the request item.

The general steps are not difficult, but an example of each of these steps is useful:

  1. Get RITM record using Req ID associated with the RITM 
  2. Validate the record to ensure that RITM exists and the stage is approval
  3. Get the sysapprover_approval record using RITM ID from step 1
  4. Impersonate the approver
  5. Open the approval form using Approval ID from step 3

Resolution

This example will be built on the first 6 steps of the out-of-box test named Search and Open Catalog Item.

This KB adds or updates 7 more steps to ensure that each approver that you want to use is opening his own approval record and updating the state to approved.

The ATF images below show the progression of test steps.

 The original out-of-box 'Search and Open Catalog Item' looked like this for the catalog item 'Apple iPhone 5'.

 

For that catalog item above 'Apple iPhone 5', please note that before proceeding, if you want to actually execute this specific test, you would need to add a second approver to the workflow stage for the catalog item, so that the steps below will succeed when you search for the second approver.  This KB does not cover the addition of a second approver to the workflow stage.   

Your own catalog item has that second approved, and it's more expedient to modify your own test by adding the steps below to your test, rather than to create and debug this example of an ATF test for a two-approval catalog item.

Here are the steps to add to your test, or to add to the out-of-box 'Search and Open Catalog Item' test:

__________


Step 7 Record Query - to get RITM record using Req ID from step 6

__________


Step 8 Record Validation - to ensure that the RITM exists and the stage is approval

__________

Step 9 Record Query - To get sysapprover_approval record using RITM ID from step 7

__________


10 Impersonate - impersonate (second) approver to validate

 

__________


11 Open the existing record - To open approval form using Approval ID from step 9

__________


12 Set Field Values - You can set the state to Approved

__________


13 UI action button - Click Update button to save the form

__________


After 13, remove steps 14 to 19 from out-of-box test named 'Search and Open Catalog Item'.  Just put a checkbox next to each step to delete and click the Delete option in the dropdown at the bottom of the list. 

 

__________

The final test looks like this:  

 

__________

The ATF test steps above explain how to search for the second approver in a service catalog request item (RITM), impersonate that approver, open the approval form, and approve the RITM.


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.