Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

The field 'parent' in CSM/FSM Configurable Workspace not copied from Work order to Work order task

ItayB
Tera Contributor

 

For some reason this works in the BACK-END, but when I am in the WORKSPACE the field is not copied. (Picture attached)

 

ItayB_0-1761128722199.png

 

You can also see that in the past this did work, but I have no idea what happened that stopped working.

 

ItayB_1-1761128816523.png

 


There is an existing BR in the system that performs the copying but as you can understand it does not affect the WORKSPACE.
I am also attaching a picture of the BR that belongs to the system.

 

ItayB_2-1761128859551.png

ItayB_3-1761128873461.png



In addition i add a photo of the configuration: 

ItayB_4-1761128912593.pngItayB_5-1761128926083.pngItayB_6-1761128940092.png

 


I would be happy for your help with this issue.

Thank you very much !
Itay

11 REPLIES 11

Agree

MaxMixali
Giga Guru

ServiceNow FSM/CSM: 'Parent' Field Not Copied from Work Order to Work Order Task

-------------------------------------------------
Question
-------------------------------------------------
The field 'parent' in CSM/FSM Configurable Workspace is not copied from Work Order to Work Order Task.

-------------------------------------------------
Explanation
-------------------------------------------------
By default, in Customer Service Management (CSM) and Field Service Management (FSM), when Work Orders (wm_order) generate Work Order Tasks (wm_order_task), the 'parent' field is not automatically copied.

This behavior is by design. The Work Order Task creation process—driven by FSMTaskGenerator or WorkOrderTaskUtils—only maps specific fields. The 'parent' field is intentionally excluded because:
- It represents hierarchical task-to-task relationships, not Work Order-to-Task links.
- Work Orders and Work Order Tasks are different tables, so copying 'parent' could create invalid references.

-------------------------------------------------
Why It Happens
-------------------------------------------------
- The task generation logic uses a field mapping script or template that excludes the 'parent' field.
- Even though both tables contain a 'parent' field, FSM treats them differently.
- Prevents data inconsistency and unintended parent-child loops.

-------------------------------------------------
Solutions
-------------------------------------------------
Option 1 — Extend Field Mapping (Script Include)
-------------------------------------------------
1. Clone or extend the FSMTaskGenerator Script Include.
2. Override the copyFields() method to include:
taskRecord.parent = workOrder.parent;
3. Register your custom Script Include via system property:
com.snc.fsm.task_generator.class_name

Option 2 — Business Rule (Recommended, Simple)
-------------------------------------------------
Table: wm_order_task
When: Before Insert
Condition: current.parent.nil()

Script:
(function executeRule(current, previous /*null when async*/) {
if (!current.parent && current.wm_order) {
var wo = new GlideRecord('wm_order');
if (wo.get(current.wm_order))
current.parent = wo.parent;
}
})();

This ensures the Parent field is copied from the originating Work Order to its tasks safely.

Option 3 — Flow Designer (No-Code)
-------------------------------------------------
1. Trigger: Work Order Task created
2. Action: Lookup Record → Work Order (current.wm_order)
3. Action: Update Record → Set Parent = Lookuped Work Order.Parent

-------------------------------------------------
Best Practice
-------------------------------------------------
- Keep 'parent' for task-to-task relationships.
- Use 'wm_order' reference for grouping tasks under a Work Order.
- Use visual components in Configurable Workspace to show hierarchy instead of copying parent values directly.

-------------------------------------------------
Summary
-------------------------------------------------
| Issue | Cause | Solution |
|--------|--------|-----------|
| Parent not copied | Not mapped in generation logic | Add BR or extend Script Include |
| Workspace view empty | Expected behavior | Populate via BR or Flow |
| Data integrity | Protected by design | Maintain clean parent/child links |

-------------------------------------------------
Final Answer
-------------------------------------------------
The 'Parent' field is not copied from Work Order to Work Order Task because it is excluded from default FSM field mappings. To propagate it, implement a Business Rule or custom Script Include override to safely copy the field from the parent Work Order.