WebAPI – How can I change the work order state?
This method allows you to change a work order state.
The method to be used for changing the work order change is: Post {{url}/api/{{tenant}}/{{organization}}/maintenance/workorders/changeSchemaEntityState/{{companyKey}}
The parameters in the method are:
- companyKey: company key
Json example to change a word order state
- {
"workOrderKey": "0000000001"
"schemaEntityStateKey": "002WORKORDER",
"stateChangeDate": "2019-08-01 09:30:00 +00:00",
"stateJustificationRemarks": "Motivo",
“applyDowntimeToChildren”: true,
“closeDowntime”: false
}
This method allows to change a work order state according to the following parameters filled in
- WorkOrderKey: the key of the work order. This field is required.
- schemaEntityStateKey: the key of the new WO state. This field is required.
- stateChangeDate: the date of the state modification. If not filled in, the current date wil be used.
- stateJustificationRemarks: state modification reason. This field might be mandatory if the state modification requires it.
- applyDowntimeToChildren: Specification to create downtime reports for all child asset of the active work order. The assets are only recorded if the new state starts the downtime record.
- closeDowntime: Specification to close all the pending downtime records associated to the work order. Only applicable if the new state of the work order closes the downtime records.
When a method is executed successfully, it returns a HttpStatusCode.OK with the state modification information.