
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 05:55 AM
For the above question, a group has a record producer related to our conference room.
One question is a Yes/No variable.
If Yes, the goal is to create a new Inc Task and assign it to a group. An alert, if you will.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 07:11 AM
Hi @jbasa ,
You can write code in the script field for record producer. Below script field will check the variable value and perform login mentioned in the condition.
Dummy variable used to explain the script - want_to_book
Script :
current.short_description = 'Book your Room';
var isTrue = producer.want_to_book;
if(isTrue == "Yes")
{
var grIncTask = new GlideRecord('incident_task');
grIncTask.initialize();
grIncTask.incident = current.sys_id;
grIncTask.short_description = producer.short_description;
grIncTask.assignment_group = '<Sys ID of Group>';
grIncTask.insert();
}
If I am able to help you with your question, Please click the Thumb Icon and mark as Correct.
Regards,
Pushkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 07:11 AM
Hi @jbasa ,
You can write code in the script field for record producer. Below script field will check the variable value and perform login mentioned in the condition.
Dummy variable used to explain the script - want_to_book
Script :
current.short_description = 'Book your Room';
var isTrue = producer.want_to_book;
if(isTrue == "Yes")
{
var grIncTask = new GlideRecord('incident_task');
grIncTask.initialize();
grIncTask.incident = current.sys_id;
grIncTask.short_description = producer.short_description;
grIncTask.assignment_group = '<Sys ID of Group>';
grIncTask.insert();
}
If I am able to help you with your question, Please click the Thumb Icon and mark as Correct.
Regards,
Pushkar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 08:07 AM
@Pushkar-Snow The variable is part of variable set. Do I need to remove that variable from the variable set and create it under Variables as shown in your example for this to work?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 08:15 AM - edited 01-13-2023 08:18 AM
My bad, mine was a select box not Yes/No.