
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2018 03:58 AM
Hi Everyone,
We have a requirement where we need to test a Standard change request validation through ServiceNow ATF.
We have followed the below link:
1. https://greg-grabowski.com/test-standard-change-automated-test-framework/
2.https://greg-grabowski.com/test-standard-change-automated-test-framework-part-2/.
The issues which we are facing is that the default value of the change request type is set to standard(by following the above link), so we couldn't able to perform other tests where we need to test other change types.
is there any workaround to test standard change request.
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 01:15 AM
Hi Fedrick
You can use the query in the below format:
var standardTemplate = new GlideRecord('std_change_record_producer');
standardTemplate.addQuery('active', true);
//You can also add a query to get the required template
standardTemplate.query();
standardTemplate.next();
var gr = new GlideRecord('change_request');
gr.applyTemplate(String(standardTemplate.template.name)); //This step applies the queried template
gr.setValue('type', 'standard');
gr.setValue('short_description', 'This is my short descr');
var sysID = gr.insert();
--
Cheers
Ankush

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2018 03:22 AM
Hi Ankush,
It really worked for us. Thanks for your replies.
I have posted a another question regarding "Risk assessment"( https://community.servicenow.com/community?id=community_question&sys_id=c00a9c35db152b00107d5583ca9619e9).
Please guide me on the same.
Much appreciated,
Fedrick

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2018 03:28 AM
Just replied to that too 🙂