How do I create multiple change tasks when a change request is submitted with a specific selected category as the condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 10:07 AM
I want the change task (or multiple tasks) to be created when the user submits a change request with the selected category "System Software".
Here is what I have:
function onSubmit() {
var cat = g_form.getValue('category');
if(cat == "System Software")
{
var cTask = new GlideRecord('change_task');
cTask.initialize();
cTask.assignment_group = current.assignment_group;
cTask.short_description = 'Install URS Launcher on ' + pc;
cTask.insert();
}
- Labels:
-
Flow Designer
-
Workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 10:15 AM
Hi,
Are you getting the same task which is generated from script multiple times or a different task?
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 10:17 AM
and also can you share your complete onSubmit client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 10:34 AM
my full client script is above
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2022 06:16 AM
My bad!
You cannot use GlideRecord in client scripts.
GlideRecord is meant for server scripts only.
Create a business rule on change request table instead of client script.
Condition: INSERT
Filter : category is System software
script
if(current.category == "System Software") //check system software backend value
{
var cTask = new GlideRecord('change_task');
cTask.initialize();
cTask.assignment_group = current.assignment_group;
cTask.short_description = 'Install URS Launcher on ' ;
cTask.insert();
}
Mark as correct and helpful if it solved your query.
Regards,
Sumanth