create a Variable named as Cyber and it is a Yes/No type variable created this for a record producer

Shaik Najma
Tera Contributor

created record producer variablle named as cyber and it is Yes/No type variable 

If user selects yes on form and submitted incident from portal then Type of the incident should be security 

1 ACCEPTED SOLUTION

Tanushree Maiti
Tera Patron

Hi @Shaik Najma 

 

Using Producer script - you can do it.

current.short_description = producer.short_description;

current.description = producer.description;

if (producer.cyber == 'Yes')

{

current.u_type = 'security';

}

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

View solution in original post

3 REPLIES 3

sureshpalla
Tera Contributor

 

You can achieve this through the Record Producer Script since you are using a Yes/No variable (cyber).

If the user selects Yes, you can automatically set the Incident Type to Security during record creation.

Add the following script in your Record Producer > Script:

 

 
if (producer.cyber == 'true') {
current.contact_type = 'security'; // replace with correct field if needed
}
 

 

 

If you are updating the Incident Type field, use the actual backend field name and the correct choice value for Security:

 

 
if (producer.cyber == 'true') {
current.incident_type = 'security';
}
 
 

Please verify:

  • Variable name is cyber
  • The target field name on Incident table

The backend choice value for Security (may differ from display value)

Ankur Bawiskar
Tera Patron

@Shaik Najma 

so what script you used and where are you stuck?

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Tanushree Maiti
Tera Patron

Hi @Shaik Najma 

 

Using Producer script - you can do it.

current.short_description = producer.short_description;

current.description = producer.description;

if (producer.cyber == 'Yes')

{

current.u_type = 'security';

}

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti