WebAPI – How can I change the work order state?

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:
  1. companyKey: company key
Json example to change a word order state
  1. {
    "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
  1. WorkOrderKey: the key of the work order. This field is required.
  2. schemaEntityStateKey: the key of the new WO state. This field is required.
  3. stateChangeDate: the date of the state modification. If not filled in, the current date wil be used.
  4. stateJustificationRemarks: state modification reason. This field might be mandatory if the state modification requires it.
  5. 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.
  6. 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.