Customize the work order state transition map
- UpdatedJul 31, 2025
- 1 minute read
- Zurich
- Field Service Management
Users with the system administrator role can customize the work order state transition map, which maps work order states to project task states.
Updating the state of a work order also updates the state of the linked project task. The FieldServicesProjectTaskStateHandler script maps the work order states to the project task states. Users with the system administrator role can customize this state transition map as needed based on the following examples.
Examples
this.workOrderProjectTaskStateMap[FieldServiceProjectTaskStateHandler.WORK_ORDER_STATE_CLOSE_COMPLETE] =
FieldServiceProjectTaskStateHandler.PROJECT_TASK_STATE_CLOSE_COMPLETE;
this.workOrderProjectTaskStateMap[FieldServiceProjectTaskStateHandler.WORK_ORDER_STATE_PENDING_DISPATCH] = FieldServiceProjectTaskStateHandler.PROJECT_TASK_STATE_OPEN;
To qualify a task automatically once the project task is changed to Open, change the FieldServiceProjectUpdateHandler process function that listens on project task updates and change the linked work order to Qualified. Add the following line after this section:
If(taskJSON.change_map.state == FieldServiceProjectTaskStateHandler.PROJECT_TASK_STATE_OPEN
workOrder.state = FieldServiceProjectTaskStateHandler. WORK_ORDER_STATE_PENDING_DISPATCH
workOrder.update();