- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2020 11:15 PM
Hi All,
Working on test case for creation of problem from incident. After submitting the incident form a problem record is created.
I want to access that record via the problem reference field from the incident. How to do that via server side script in atf?
Please let me know if we have any other alternative to achieve this as I need to open the problem record and then validate some field values.
Ps: Already tried via open problem record in the list view, but it doesn't seem to do anything after opening the list view.
Thanks
Solved! Go to Solution.
- Labels:
-
Automated Test Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2020 08:51 AM
Hi Archana,
Here is the approach I used to test the problem created from Incident.
I was able to open successfully the problem record which got created after clicking the UI Action "Create Problem"
Script Used in Run Server Side Script: I have given Step 3 sys_id since UI Action would be clicked from that incident
You give yours
(function(outputs, steps, stepResult, assertEqual) {
// add test script here
var incRec = new GlideRecord('incident');
incRec.get(steps('21af3568db1d141059badd384b961901').record_id); // sys_id of step 3
outputs.table = 'problem';
outputs.record_id = incRec.problem_id;
stepResult.setOutputMessage("Successfully Found Problem record");
return true;
})(outputs, steps, stepResult, assertEqual);
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
04-08-2021 10:01 PM
Can you please post a new question for this as this thread is quite older.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2021 10:38 PM
Hi Ankur,
I have posted a new question. Could you please take a look and help me please ASAP. Below is link to the post/question.
Thanks,
Srinath.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2021 10:07 PM
Hi @Ankur bawiskar,
How to get record sys_id from step where you submitted incident record?? Data will not exist in real time whichever done through ATF.So, where sys_id gets populate to copy that.
Please need answer for this
Thanks,
Jayaram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2021 10:55 PM
Hi,
When you use Submit a form step it has output variable as record_id
you can use that to get the submitted record sys_id
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-18-2022 07:04 AM
Hi Ankur;
Here you hard-coded the sys_id of step three. This value gets changes every time you running the ATF. This sys_id of the created record. How to make it dynamic. This means I need to pass the sys_id of the previous step.
Thanks
Balaji Prusty