
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 01:53 PM
Hi all,
I am creating an end to end ATF test case where the user is submitting a laptop request, the request gets approved and fulfilled.
I have a step where I am retrieving a system value using the 'run server script' test step. here, I want to know the sys_id of the ticket created by the last step.
The above step does not work correctly as the 'steps(SYS_ID of the previous step)' is evaluated as undefined. I have validated that I am using the correct sys_id. the step being referred to here is a record query that is able to query at least 1 record and works correctly. I don't think this issue could be related to user access as the user impersonated here is an ITIL user.
Thanks,
Ravish
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2020 09:15 AM
record query step has output as "first_record"
so please update it as below and it should work
gr.get(steps('sys_id').first_record);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2020 09:15 AM
record query step has output as "first_record"
so please update it as below and it should work
gr.get(steps('sys_id').first_record);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2020 07:11 AM
Thanks, Ankur. This worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2020 07:19 AM
You are welcome
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 05:54 AM
Hi @Ankur Bawiskar,
1) record a query with some specifications and
2) open that form(I mean record).
I have already written above 2 steps and now
3) I need to write the server side script for getting the record's sys_id which I have opened in step 2
how to achieve 3rd step(server side script) in ATF ?