How to reference to field type 'reference' in ATF?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2018 04:00 AM
Hello,
I'm implementing a test with Automated Test Framework. This test is filling in a Catalog Item which has one field of type 'Reference'. The value I want to fill it with is a record created earlier in the same test.
Is there a possibility to fill the Reference-field with reference to the record created earlier? I've tried to use the Record Query -step and use that value as a fill-in, but with no success. That comes with an error:
FAILURE: Failed to set field 'Shipment' to value '{{step['931e008f459d1b00f64b8393ebb758ea'].first_record}}' because the reference is NOT valid.
Note: 'Shipment' is the field I'm trying to fill.
One working option is to create the 'Shipment' by hand, and then reference to the same record in all tests, but for me that kinda overrides the ServiceNow's idea of "every test should be a standalone".
- Labels:
-
Automated Test Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2018 07:21 AM
Is there even a way to do this? Not supported / a bug / should this be reported to HI?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2018 04:25 AM
I had a similar issue and opened a HI ticket. They had PRB1240363 already open for this, which states:
When a previous test step does a query on a table which returns multiple records (i.e. the user table) and a later step is intended to use the result from this step, an error is sometimes generated and the test fails. This has been demonstrated for the sys_user table when doing a query which is intended to return all active records.
In addition, when viewing the step which uses the results from this previous step, the output appears in an unexpected format:{{step['xxxx']...}}
They informed me that this would be fixed in the London release.