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.

Need help to auto populate field values from business rule

Shruthi1987
Tera Contributor

Hi,

I`m trying to create abusiness rule to auto populate below fields for an incident form using script.

Category (category): Security
Sub category (subcategory): Other  
Channel (contact_type): Event

 

Could you please help me how to auto-populate the values like security, other, and event using script?

 

Thanks & Regards,

Shruthi

1 ACCEPTED SOLUTION

dgarad
Giga Sage

Hi @Shruthi1987 

Please refer to below code.

current.category= 'security'; // back end name 
current.sub_category= 'other';
current.contact_type= 'event';

 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

View solution in original post

5 REPLIES 5

swathisarang98
Giga Sage

Hi @Shruthi1987 ,

 

When do you want to auto populate these values ? is it on insert of incident creation or on update ?Could you please explain the requirement in detail ?

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

Hi @Shruthi1987 ,

 

if the requirement is straight forward then you can add condition based on which the business rule should trigger and in action section you can set the value ,

swathisarang98_0-1715151035238.png

swathisarang98_1-1715151057659.png

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

 

dgarad
Giga Sage

Hi @Shruthi1987 

Please refer to below code.

current.category= 'security'; // back end name 
current.sub_category= 'other';
current.contact_type= 'event';

 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

Thanks for your Answer. It Works!