How to copy a field from a subworkflow to a task created in the parent workflow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 02:39 PM
Hello all and thanks for the help, I have a task to copy a field from a sub workflow task to a task that is created in the parent workflow. Both tasks are on the same table (task) bellow is the client script that I have been trying to get to work. Thanks again for the help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 04:18 PM - edited 02-03-2025 04:20 PM
where is this script in the scheme of things? looks like a client script, which isn't going to work because you cant do a glide lookup in a client script. You'd need to use ajax.
if your script is in a workflow that runs on the child task, then you can just use this:
var shortDesc = current.short_description
var saMig = current.u_sa_migration_file;
var grpar = new GlideRecord('task'); //assuming it is in the task table, otherwise change to appropriate table
grpar.get(current.parent); //likewise change if field name of parent differs
if (shortDesc.indexOf('Migration Task - GIT WAR TASK') > -1){
grpar.u_sa_migration_file = saMig;
grpar.update();
}
if you're not committed to workflow editor just yet, it might be a good idea to migrate it to flow designer - then you could just use the breadcrumbs
if the script is outside of a workflow / flow - then you should consider a business rule