- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2023 07:50 AM
Happy Monday
I am unable to find a way to set the change request addition condition for a CAB definition using ATF . Any ideas? I tried working around it but it is mandatory so the process is not working properly. Custom UI does not find it. (t is not an option in the set field values. I want to be able to add a request state criteria. There is a modified fields option but not sure what that does.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2023 06:12 AM
Hi @Latoya ,
please find the below script for reference.
(function(outputs, steps, params, stepResult, assertEqual) {
// add test script here
var testGr = new GlideRecord("cab_definition");
//testGr.get(steps('5f2656eb47603d10a54e5d0f536d438d').record_id);
testGr.initialize();
testGr.setValue("change_condition", "typeINnormal,emergency^riskIN2,3^category=Network^ORcategory=Hardware^EQ");
testGr.setWorkflow(false);
var newRecordSysId = testGr.insert();
var newTestGr = new GlideRecord("cab_definition");
if (newTestGr.get(newRecordSysId)) {
stepResult.setOutputMessage("Successfully inserted cab_definition record");
outputs.table = "cab_definition";
outputs.record_id = newRecordSysId;
return true;
} else {
stepResult.setOutputMessage("Failed to insert cab_definition record");
return false;
}
})(outputs, steps, params, stepResult, assertEqual);
make sure to follow the below step as suggested by the article above.
I hope this helps!
Regards,
Hemant
**Please mark the appropriate response as the correct answer and helpful, This may help other community users to follow the correct solution.**
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2023 08:14 AM
Hi @Latoya ,
please find the below support article which will help you to achieve your task.
Workaround for cannot find condition fields in [Set Field Value] or [Record Insert] in ATF
I hope this helps!
Regards,
Hemant
**Please mark the appropriate response as the correct answer and helpful, This may help other community users to follow the correct solution.**
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2023 01:22 PM
Hi Thank you so much
Do you have an example of a script for the "insert here" that I can reference?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2023 06:12 AM
Hi @Latoya ,
please find the below script for reference.
(function(outputs, steps, params, stepResult, assertEqual) {
// add test script here
var testGr = new GlideRecord("cab_definition");
//testGr.get(steps('5f2656eb47603d10a54e5d0f536d438d').record_id);
testGr.initialize();
testGr.setValue("change_condition", "typeINnormal,emergency^riskIN2,3^category=Network^ORcategory=Hardware^EQ");
testGr.setWorkflow(false);
var newRecordSysId = testGr.insert();
var newTestGr = new GlideRecord("cab_definition");
if (newTestGr.get(newRecordSysId)) {
stepResult.setOutputMessage("Successfully inserted cab_definition record");
outputs.table = "cab_definition";
outputs.record_id = newRecordSysId;
return true;
} else {
stepResult.setOutputMessage("Failed to insert cab_definition record");
return false;
}
})(outputs, steps, params, stepResult, assertEqual);
make sure to follow the below step as suggested by the article above.
I hope this helps!
Regards,
Hemant
**Please mark the appropriate response as the correct answer and helpful, This may help other community users to follow the correct solution.**
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2023 12:38 PM
@Hemant Goldar Thank you sooooooooooooo much. I was able to add the values I needed. Woot Woot!
