Create a work order

Learn how to create work orders through the API using different methods including from pending tasks, unscheduled tasks, work requests, and event-triggered tasks.

With this API, you can create a work order in the following ways:

  • From pending tasks.
  • From an unscheduled task.
  • From an unscheduled task with information from an event.
  • From an event-triggered task.
  • From a work request.

This web service is part of the ADVANCED APIs add-on.

Notes:

  1. For creating WOs with tasks found in pending tasks, take into account: To obtain the IDs of the pending tasks that you want to turn into a WO, you must consult the API Query pending tasks

  2. For creating WOs by creating from an unscheduled task, here are the following options:

    1. Unscheduled WO, through this option all task information must be sent to the endpoint.
    2. Unscheduled WO triggered by event, through this option the task will take as a base all information contained in the event of the task plan. For this, take into account:
      The event from which the data is taken cannot have associated resources.
      To obtain information related to the trigger and the task, it is necessary to consult the web service Query detailed information from task plans
  3. For creating WOs based on a work request, the work request must be active and cannot be associated with another WO. Work requests can be consulted here

Input parameters for creating a WO from a pending task

The following information must be sent in the request body.

ParametersTypeRequiredDescription
typeIntegerYesWO creation type, for this case it is 1
responsible_codeTextOptional if third party information is sentCode of the human resource who will be responsible for the WO. Can be consulted here. (field code)
third_party_codeTextOptional if human resource information is sentCode of the third party where the contact who will be responsible for the WO is located. Can be consulted here. (field code)
third_party_contactTextOptional if human resource information is sentName of the contact who will be responsible for the WO
account_codeTextYesCode of the user account that will be registered as the creator of the WO. The user must be of the human resources type
tasks_todoJSON ArrayYes

Array with pending tasks information.

Each json must contain the tasks_todo_id parameter that corresponds to the task id in pending tasks

annotationsJSONNoThe annotations object must comply with the following validation rules:
• Must contain at least one of the allowed fields: "id_wo_related" : "string", "code_wo_related" : "string", "wo_related_status" : "string"

Input parameters for creating a WO from an unscheduled task

The following information must be sent in the request body.

ParameterTypeRequiredDescription
typeIntegerYesWO creation type, for this case it is 2
item_codeTextYesCode of the asset associated with the WO. Can be consulted here. (field code)
responsible_codeTextYesCode of the human resource or third party associated with the WO
account_codeTextYesCode of the account that creates the WO. The user must be of the human resources type
requested_byTextYesRequested by
task_descripcionTextYesTask description, which must not exceed 200 characters
task_type_mainTextYesTask type
task_type_description TextOptionalTask classification 1
task_type_2_description TextOptionalTask classification 2

Input parameters for creating a WO from an unscheduled task with event information

The following information must be sent in the request body.

ParameterTypeRequiredDescription
type IntegerYesWO creation type, for this case it is 3
item_code TextYesCode of the asset to which the WO will be performed
responsible_code TextOptional if third party information is sentCode of the human resource who will be responsible for the WO
third_party_code TextOptional if human resource information is sentCode of the third party where the contact who will be responsible for the WO is located
third_party_contact TextOptional if human resource information is sentName of the contact who will be responsible for the WO
account_code TextYesCode of the user account that will be registered as the creator of the WO. The user must be of the human resources type
requested_by TextYesRequested by
id_task IntegerYesID of the task from which information will be obtained to create the WO
tasks_triggers_id IntegerYesEvent ID
id_group_task IntegerYesID of the task plan where the task from which information will be obtained is located
task_descripcion TextOptionalTask description (Default is the task name from id_task), which must not exceed 200 characters
task_type_main TextOptionalTask type (Default is from the task of id_task)
task_type_description TextOptionalTask classification 1 (Default is from the task of id_task)
task_type_2_description TextOptionalTask classification 2 (Default is from the task of id_task)
noteTextOptionalNote of the task associated with the WO

Input parameters for creating a WO from a work request

The following information must be sent in the request body.

ParameterTypeRequiredDescription
typeIntegerYesWO creation type, for this case it is 2
item_codeTextYesCode of the asset associated with the WO. Can be consulted here. (field code)
responsible_codeTextYesCode of the human resource or third party associated with the WO
account_codeTextYesCode of the account that creates the WO. The user must be of the human resources type
requested_byTextYesRequested by
task_descripcionTextYesTask description, which must not exceed 200 characters
task_type_mainTextYesTask type
id_requestIntegerYesWork request ID. Can be consulted here. (field id_code)

Input parameters for creating a WO from an event-triggered task

The following information must be sent in the request body.

ParameterTypeRequiredDescription
typeIntegerYesWO creation type, for this case it is 4
item_codeTextYesCode of the asset to which the WO will be performed
responsible_codeTextOptionalCode of the human resource who will be responsible for the WO
third_party_codeTextOptionalCode of the third party where the contact who will be responsible for the WO is located
third_party_contactTextOptionalName of the contact who will be responsible for the WO
account_codeTextYesCode of the user account that will be registered as the creator of the WO. The user must be of the human resources type
requested_byTextYesRequested by
id_taskIntegerYesID of the task from which information will be obtained to create the WO
tasks_triggers_idIntegerYesEvent ID
id_group_taskIntegerYesID of the task plan where the task from which information will be obtained is located
date_maintenanceTextOptionalWO scheduling date. Format: 'YYYY-MM-DDTHH:MM:SS-UTC'
noteTextOptionalNote of the task associated with the WO

Output parameters

ParameterTypeDescription
wo_folioTextWO ID
creation_dateTextWO creation date
durationIntegerWork order duration
id_works_ordes_taskIntegerTask ID
id_status_work_orderInteger1: WO in Process
2: WO under Review
3: WO Completed
4: WO cancelled
final_dateTextTask final date
completed_percentageTextWork order completion percentage
created_byTextWork order generator name
codeTextAsset code
items_log_descriptionTextAsset description
doneTextTrue if task is already finished and False if task is not finished
descriptionTextTask description
id_requestTextRequest ID, if task comes from a request
stop_assetsTextTrue if asset is stopped and False if asset is NOT stopped
stop_assets_secIntegerAsset stop time (seconds)
tasks_log_task_type_mainTextTask type
parent_descriptionTextAsset location
resources_hoursTextSum of hours of human resources used
trigger_descriptionTextTrigger type
resources_inventoryTextInventory type resources in task
resources_human_resourcesTextHuman resources in task
cal_date_maintenanceTextTask calculated date
real_durationIntegerTask real duration
date_maintenanceTextTask scheduling date
user_assignedTextAssigned user
noteTextWork order note
details_signatureTextWork order signature details
first_date_taskTextStart date of the next task to be performed
costs_center_descriptionTextAsset cost center
tasks_durationTextTask estimated duration
total_cost_taskTextWO total cost
requested_byTextRequester of an unscheduled task
groups_descriptionTextAsset 'Type' information
groups_1_descriptionTextAsset classification 1
groups_2_descriptionTextAsset classification 2
has_childrenTextTrue if work order has child work orders
real_stop_assets_secTextAsset real stop time
wo_final_dateTextWork order final date
tasks_log_types_descriptionTextTask classification 1
tasks_log_types_2_descriptionTextTask classification 2
ratingTextWO rating
code_responsibleTextWO responsible code
work_orders_status_custom_descriptionTextCancellation reason
types_descriptionTextFailure type
causes_descriptionTextFailure cause
detection_method_descriptionTextFailure detection method
severiry_descriptionTextFailure severity
damages_types_descriptionTextType of damage caused
caused_damageTextCause of damage caused
id_prioritiesTextTask priority ID
priorities_descriptionTextTask priority description
annotationsJSONObject containing additional information.
"id_wo_related" : "string", "code_wo_related" : "string", "wo_related_status" : "string"

Examples:

Tasks from pending tasks:

Request: (POST)https://app.fracttal.com/api/work_orders

{
    "type":1,
    "responsible_code": "7809097-2",
    "account_code": "7845123",   
    "tasks_todo":[
        {
            "tasks_todo_id":1600093
        },
        {
            "tasks_todo_id":1087
        }
    ],
    "annotations": {
            "id_wo_related": "12345",
            "code_wo_related": "WO-2025-001",
            "wo_related_status": "OPEN"
    }
}
{
    "success": true,
    "message": "200",
    "data": {
        "id": 1130348,
        "id_company": 69,
        "id_status_work_order": 1,
        "wo_folio": "OT-1731",
        "creation_date": "2021-07-27T14:43:38.330737+00:00",
        "duration": 1200,
        "id_assigned_user": null,
        "initial_date": null,
        "final_date": null,
        "completed_percentage": 0,
        "id_created_by": 40,
        "created_by": "Alejandra Arango",
        "signature": null,
        "note": null,
        "details_signature": null,
        "id_validated_by": null,
        "first_date_task": null,
        "id_personnel_log": 10073,
        "id_contacts_log": null,
        "id_parent": null,
        "is_offline": null,
        "id_account_offline": null,
        "code_created_by": "7845123",
        "rating": null,
        "enable_budget": false,
        "id_work_orders_status_custom": null,
        "review_date": null,
        "id_accounts_log_validated_by": null,
        "id_public": null,
        "statistics": null,
        "type_user": "HUMAN_RESOURCES",
        "id_responsible": 60,
        "id_account_responsible": null,
        "description": "OT-1731",
        "annotations": {
            "id_wo_related": "12345",
            "code_wo_related": "WO-2025-001",
            "wo_related_status": "OPEN"
        }
}

Creating WOs from an unscheduled task:

Request: (POST)https://app.fracttal.com/api/work_orders

{  
    "type": 2,
    "item_code": "EQM032",
    "responsible_code": "RH-002",
    "account_code": "RH-002",
    "requested_by": "Ruben Prieto",
    "task_descripcion": "Test work order",
    "task_type_main": "Corrective"
}
{
    "success": true,
    "message": "200",
    "data": {
        "id_work_order": 11934394,
        "wo_folio": "OT-2420",
        "id_work_order_task": 20338615,
        "id_status_work_order": 1,
        "user_type": "HUMAN_RESOURCES",
        "responsible": "Pepito perez",
        "responsible_code": "RH-002",
        "date_created": "2023-11-10T20:44:59.479973+00:00",
        "created_by": "Pepito perez"
    },
    "total": 1
}

Creating WOs from an unscheduled task with event information:

Request: (POST)https://app.fracttal.com/api/work_orders

{
    "type": 3,
    "item_code": "118",
    "responsible_code": "32322",
    "account_code": "25198772-2",
    "requested_by": "Fracttal SPA",
    "id_task": 86,
    "task_descripcion": "New task generated by API",
    "tasks_triggers_id": 27,
    "id_group_task": 1,
    "task_type_main": "Corrective",
    "task_type_description": "MECHANICAL",
    "task_type_2_description": "REQUIRES HEIGHT PERMIT"
}
{
    "success": true,
    "message": "200",
    "data": {
        "wo_folio": "OT-1694",
        "id_status_work_order": 1,
        "responsible": "FRACTTAL SPA",
        "responsible_code": "32322",
        "date_created": "2021-05-11T14:54:45.294203+00:00",
        "created_by": "Laura Marcela Peña Jaramillo"
    },
    "total": 1
}

Creating WOs from a work request:

Request: (POST)https://app.fracttal.com/api/work_orders

{
    "type": 2,
    "item_code": "EQM032",
    "responsible_code": "RH-002",
    "account_code": "RH-002",
    "requested_by": "Ruben Prieto",
    "task_descripcion": "Test work order",
    "task_type_main": "Corrective",
    "id_request": 1827
}
{
    "success": true,
    "message": "200",
    "data": {
        "id_work_order": 11934394,
        "wo_folio": "OT-2420",
        "id_work_order_task": 20338615,
        "id_status_work_order": 1,
        "user_type": "HUMAN_RESOURCES",
        "responsible": "Pepito perez",
        "responsible_code": "RH-002",
        "date_created": "2023-11-10T20:44:59.479973+00:00",
        "created_by": "Pepito perez"
    },
    "total": 1
}

Creating WOs from an event-triggered task:

Request: (POST)https://app.fracttal.com/api/work_orders

{
    "type": 4,
    "responsible_code": "SV-CODE",
    "account_code": "SV-CODE",
    "item_code": "F1_1190-ASST-CODE",
    "id_group_task": 277312,
    "id_task": 14011472,
    "task_trigger_id": 14011472,
    "date_maintenance": "2016-07-12T20:00:00-03", //Optional
  	"note": "TEST NOTE" //Optional
}
{
    "success": true,
    "message": "200",
    "data": {
        "wo_folio": "OT-1694",
        "id_status_work_order": 1,
        "responsible": "FRACTTAL SPA",
        "responsible_code": "32322",
        "date_created": "2021-05-11T14:54:45.294203+00:00",
        "created_by": "Laura Marcela Peña Jaramillo"
    },
    "total": 1
}
Response

Language
LoadingLoading…