Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to attach approval in the Change Request table

Hari S1
Tera Contributor

Hi,

 

In the Change Request table, I have a field called 'QA' (Choice type), When the QA field is set to 'Yes' and the state changes to 'Assess,' I would like to add the 'Database Group' for approval. I do not want to modify the existing flow or workflow. How can I achieve this without changing the existing flows?

Thanks

6 REPLIES 6

PritamG
Mega Guru

create new business rule on the change request table. set the trigger to after update with conditions: QA is yes and state changes to assess. use the condition in script.

if (current.qa == 'Yes' && current.state == 'Assess') {
var approvalGroup = new GlideRecord('sysapproval_group');
approvalGroup.initialize();
approvalGroup.approval = current.sys_id;
approvalGroup.group = 'Database Group Sys ID'; // Replace with the actual sys_id of the group
approvalGroup.insert();
}

then save and test.

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Hari S1 

 

Best option is via Change approval policies which is low code.

AGLearnNGrow_0-1735766400638.pngAGLearnNGrow_1-1735766415638.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

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/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************