Automated Test Framework - Cannot validate Additional Comments or Work Notes

dbrown008
Kilo Contributor

In our instance, we have a business rule that will add the Close Notes of a Incident or Catalog Task to the Work Notes of the Parent Record.  In other words, once a subtask closes, the Close Notes will be copied into the Work Notes of the Parent Task.

When I attempt to use a Server Validate or Form Validate in Automated Testing to make sure the Work Notes are updated, I cannot find the fields anywhere to do so.

Steps followed in Automated Test Framework

  1. Create Record Producer (for Catalog Item)
  2. Set Variables in Catalog Item
  3. Submit Record Producer
  4. Record Insert - sc_task with Step 3 as Parent
  5. Record Query to confirm Parent - Child Relationship
  6. Record Update - Fill in Mandatory Fields
  7. Open Existing Task
  8. UI Action to Close Task
  9. Open the RITM Form (generated from Catalog Item)
  10.  ****Cannot find Fields to verify Work Notes updated from sc_task Close Notes****

The ServiceNow docs have failed me.

9 REPLIES 9

dbrown008
Kilo Contributor

Hi Nitesh,

 

I tried creating a script to read the sys_journal_field table with a Server Side script, but I cannot figure out how to get the current open form id in the automated test.  Any thoughts on how to accomplish what you mentioned?

When you say you want to open the form id you mean you want to open the parent record where the work notes have been inserted?

Hi Nitesh,

That is correct. The "Close Notes" field from the INCTASK will be copied into the "WorkNotes" field of the parent INC.

Yaraslau
Tera Guru

You should use Step->Server->Record Query. Then choose table 'sys_history_line'. Look gif.

Matt102
Giga Guru

I found Yaraslau's gif exceedingly helpful. Sadly in my sys_history_line table I wasn't able to find details of the record I created in the ATF tests. Working with my ignorance I reverted to using the sys_audit table and, though unable to snag the ids for user or created record (greyed out!?) I was able to construct a test that did what I wanted. As the image does not exactly show:

  • Table Name was the name of the task extended custom scope table that I was testing
  • New Value was the work_note the previous step had added
  • Instance: Orlando

find_real_file.png