- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 12:43 AM - edited 10-26-2023 04:57 AM
Hi,
I was wondering how to add change tasks (20+) to a change request when the short description of the change request is "Server test", using workflow. Each task has a different name/type/assignment group/assigned to.
EDIT: For some tasks, the assigned to needs to be the requestor itself. Do I just put "assigned to" as empty in the Create task activity, and put "task.assigned_to = gs.getUserID();" in the script like this? Or do I remove remove "assigned to" in the variables and just have the script?
I've never worked with workflow before so any help is appreciated!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 01:48 AM
Hi @JordyZ I would suggest to use Create Task activity in this case, your job will be easier to maintain 20 tasks in future
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 12:57 AM - edited 10-26-2023 12:58 AM
Hi @JordyZ You can use run script activity to create 20+ change task like below
if(current.short_description == 'Server test') // short desc of change request
for(var i =0 ; i< 20 ; i++) // to create 20 task
{
var chgTask = new GlideRecord('change_task');
chgTask.initialize();
chgTask.assignment_group.setDisplayValue("groupname");
chgTask.fieldname = ""; // for other fields mapping
chgTask.insert();
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 01:05 AM
Hi @Harish KM ,
Thanks for replying. Each of the 20+ change tasks have a different name/type/assignment group. This mean I have to manually code each task?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 01:48 AM
Hi @JordyZ I would suggest to use Create Task activity in this case, your job will be easier to maintain 20 tasks in future
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 03:19 AM - edited 10-26-2023 03:24 AM
Thanks @Harish KM !
Sorry for asking, but what would the overall workflow look like, do I need to use Branch/Join activity or anything else?
The change tasks should be created in a specific order, is it possible to put order value at Create Task activity?
Kind regards,
Jordy