Want to impersonate a user that is referenced in a field from a previous step, where I opened a form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hi Team,
I am working on ATF in Zurich release for an GRC module.
I want to impersonate a user that is referenced in a field from a previous step, where I had opened a form using ATF.
Please find the attached screenshot for the same.
Also, please assist how can I create ATF test case for assessments in GRC module.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi @dhirajmishr
I think you need to fix the impersonation user in ATF. We can’t proceed based solely on the record.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Steps
1) Use "Run Server Side Script" step and use this script
// give sysId of the previous step here
var incRecordSysId = steps('c056cd85c317bed05b9c7fedd4013195').record_id;
var gr = new GlideRecord("incident");
gr.addQuery("sys_id", incRecordSysId);
gr.query();
if (gr.next()) {
outputs.table = 'sys_user';
outputs.record_id = gr.assigned_to;
stepResult.setOutputMessage("Assigned to user found " + gr.assigned_to.name);
return true;
} else {
stepResult.setOutputMessage("Record not found");
return false;
}
In below image you need to remove toString() from script which I already did above and return true, false is also to be corrected
2) Impersonate User step picks that assigned to user dynamically and impersonates with that from previous step
Steps look like this
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Steps
-> I created new INC and set some field values and Submitted the form
-> then I used Server Side Script Step to grab the assigned to of that INC and took output from Submit a Form step
-> then I impersonated with that assigned to user
see working output I attached as gif
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
