Class WorkOrder

Hierarchy

  • WorkOrder

Properties

admin: any

WorkOrder Administration methods

attachments: any

WorkOrder Comments methods

comment: any

WorkOrder Comments methods

costs: any

WorkOrder Costing methods

WorkOrder Options Methods

  • Get Categories

    Returns

    Returns Promise that represents an array of configured workorder category code descriptions

    Returns Promise<unknown>

  • Get Cycle From

    Returns

    Returns Promise that represents an array of string/string Cycle From options for workorders

    Returns Promise<unknown>

  • Get Cycle Intervals

    Returns

    Returns Promise that represents an array of string/string Cycle Interval options for workorders

    Returns Promise<unknown>

  • Get Cycle Types

    Returns

    Returns Promise that represents an array of string/string Cycle Type options for workorders

    Returns Promise<unknown>

  • Get WorkOrder Employee lists

    Returns

    Returns Promise that represents a collection of employees. See: /{subdirectory}/apidocs/#/data-type-info;dataType=EmployeeNameId

    Parameters

    • listType: string

      Which list (endpoint) to get. Includes Supervisors & SubmitTos.

    • includeInactiveEmployees: boolean = false

      Whether to include inactive employees in the returned list. Defaults to false.

    • Optional domainIds: number[]

      Filter to certain domains within the Cityworks instance.

    Returns Promise<unknown>

  • Get Expense Types

    Returns

    Returns Promise that represents an array of string/string Expense Type options for workorders

    Returns Promise<unknown>

  • Get Priorities

    Returns

    Returns Promise that represents an array of configured workorder priorities

    Returns Promise<unknown>

  • Get WorkOrder Stages

    Returns

    Returns Promise that represents an array of string/string Stage options for WorkOrders

    Returns Promise<unknown>

  • Get Status Options

    Returns

    Returns Promise that represents a collection of codes. See: /{subdirectory}/apidocs/#/data-type-info;dataType=CodeDesc

    Returns Promise<unknown>

  • Get SubmitTo list

    Returns

    Returns Promise that represents a collection of employees. See: /{subdirectory}/apidocs/#/data-type-info;dataType=EmployeeNameId

    Parameters

    • includeInactiveEmployees: boolean = false

      Whether to include inactive employees in the returned list. Defaults to false.

    • Optional domainIds: number[]

      Filter to certain domains within the Cityworks instance.

    Returns Promise<unknown>

  • Get Supervisors list

    Returns

    Returns Promise that represents a collection of employees. See: /{subdirectory}/apidocs/#/data-type-info;dataType=EmployeeNameId

    Parameters

    • includeInactiveEmployees: boolean = false

      Whether to include inactive employees in the returned list. Defaults to false.

    • Optional domainIds: number[]

      Filter to certain domains within the Cityworks instance.

    Returns Promise<unknown>

WorkOrder Search Methods

  • Get WorkOrderSid and description for provided WorkOrderId

    Returns

    Returns Promise that represents an object with WorkOrderS/IDs & Description

    Parameters

    • workOrderId: string

      The WorkOrderId for which to get the WorkOrderSid and description

    Returns Promise<unknown>

  • Get WorkOrderS/IDs connected to provided entities

    Returns

    Returns Promise that represents an array of WorkOrderS/IDs

    Parameters

    • entityType: string

      The entity type to find connected WorkOrders

    • entityUids: string[]
    • Optional search: (string | number)[]

      Any additional search properties of the WorkOrder (open/closed, etc)

    • s: boolean = true

      Get WorkOrderSids. Defaults to true. When false, returned list is WorkOrderIds

    Returns Promise<unknown>

WorkOrders Methods

  • Add entities to an existing WorkOrder

    Returns

    Returns object that represents a list of entities removed.

    Parameters

    • workOrderSId: string | number

      The workorder S/ID which the entities should be added to. # for SID, string for ID.

    • entityInfo: Object

      Entity info object including: (req) EntityType: {string}, (req) EntityUids: {Array}, Facility_Id: {string}, Level_Id: {string}

    • updateXY: boolean = true

      Update WorkOrder xy after adding entit(y|ies), default is true.

    Returns Promise<unknown>

  • Cancel workorders

    Returns

    Returns object that represents a collection of workorders

    Parameters

    • workOrderIds: number[]

      An array of the IDs to cancel the matched workorders

    • Optional cancelReason: string

      A reason for cancelling the workorder(s)

    • Optional dateCancelled: Date

      The date/time that it should be indicated the workorder was cancelled

    Returns Promise<unknown>

  • Close WorkOrders

    Returns

    Returns object that represents a collection of WorkOrders

    Parameters

    • workOrderIds: number[]

      An array of the IDs to close the matched WorkOrders

    Returns Promise<unknown>

  • Combine WorkOrders

    Returns

    Returns object that represents a collection of WorkOrders

    Parameters

    • fromWorkOrderIds: string[]

      The workorder IDs which should be combined.

    • toWorkOrderId: string

      The WorkOrder ID for the single WorkOrder that should contain the info/entities from the other WorkOrders

    • cancelCombinedWorkOrders: boolean = true

      If the WorkOrders combined into the single should then be canceled, default is true.

    Returns Promise<unknown>

  • Create new workorders, including linkin to Requests & Inspections (optionally)

    Returns

    Returns Promise that represents an object describing the newly-created workorder

    Parameters

    • wo_data: Object

      See /{subdirectory}/apidocs/#/data-type-infodataType=WorkOrder on the Cityworks instance

    • Optional inspectionIds: number[]

      The inspection IDs which the workorder should be linked to.

    • Optional requestIds: number[]

      The inspection IDs which the workorder should be linked to.

    Returns Promise<unknown>

  • Create new workorder linked to parent workorder

    Returns

    Returns Promise that represents an object describing the newly-created workorder

    Parameters

    • wo_data: Object

      See /{subdirectory}/apidocs/#/data-type-infodataType=WorkOrder on the Cityworks instance

    • workOrderSId: string | number

      The workorder S/ID which the entities should be added to. # for SID, string for ID.

    • s: boolean = true

    Returns Promise<unknown>

  • Delete WorkOrders

    Returns

    Returns object that represents a collection of WorkOrder Ids which have been deleted

    Parameters

    • workOrderIds: number[]

      An array of the IDs to delete the matched WorkOrders

    Returns Promise<unknown>

  • Delete Map Layer Fields

    Returns

    Returns Promise that represents a collection of Objects describing the workorders

    Parameters

    • workOrderSId: string

      The workorder S/ID to delete the map layer fields for.

    Returns Promise<unknown>

  • Get the audit log for a specific workorder

    Returns

    Returns Promise that represents a collection of Cityworks Metadata Objects

    Parameters

    • workOrderSId: number

      A WorkOrder S/ID to get the audit log for. SID is default.

    Returns Promise<unknown>

  • Get a workorder by S/ID

    Returns

    Returns Promise that represents an object describing the workorder

    Parameters

    • workOrderSId: string | number

      The S/ID of the workorder to retrieve. # for SID, string for ID.

    • s: boolean = true

      Whether first argument is an SID (true) or an ID (false). Defaults to true.

    Returns Promise<unknown>

  • Get workorders by an array of S/IDs

    Returns

    Returns Promise that represents a collection of Objects describing the workorders

    Parameters

    • workOrderSIds: (string | number)[]

      The workorder S/IDs to retrieve. If providing WorkOrderID, should be all strings, else provide all numbers for WorkOrderSID

    Returns Promise<unknown>

  • Get custom field values for the workorder S/IDs

    Returns

    Returns Promise that represents a collection of Objects describing the workorders

    Parameters

    • workOrderSIds: (string | number)[]

      The workorder S/IDs to retrieve. #s for SID, strings for ID.

    Returns Promise<unknown>

  • Get entities on an existing WorkOrder

    Returns

    Returns object that represents a list of entities removed.

    Parameters

    • workOrderSIds: (string | number)[]

      The workorder S/IDs which the entities should be added to. # for SID, string for ID.

    • getGisData: boolean = true

      Query gis to populate Entity.Attributes with current gis data. Defaults to true.

    Returns Promise<unknown>

  • Get instructions by an array of workorders S/IDs

    Returns

    Returns Promise that represents an array of String, String describing the workorder instructions

    Parameters

    • workOrderSIds: (string | number)[]

      The workorder S/IDs to retrieve. If providing WorkOrderID, should be all strings, else provide all numbers for WorkOrderSID

    Returns Promise<unknown>

  • Get Map Layer Fields

    Returns

    Returns Promise that represents a collection of Objects describing the workorders

    Parameters

    • workOrderSId: string

      The workorder S/ID to get the map layer fields for.

    Returns Promise<unknown>

  • Move a workorder's point

    Returns

    Returns Promise that represents an object describing the updated workorder

    Parameters

    • workOrderId: string
    • x: number
    • y: number
    • projection: Object

      Should include WKT or WKID attribute. Can also include VcsWKID attribute.

    • Optional z: number

      Optional Z coordinate

    Returns Promise<unknown>

  • Remove entities from a WorkOrder. Provide WorkOrderId and either ObjectIds or EntityType and EntityUids

    Returns

    Returns object that represents a list of entities removed.

    Parameters

    • workOrderSId: string | number

      The workorder S/ID which the entities should be removed from. # for SID, string for ID.

    • entityInfo: Object

      Remove entities by WorkOrderEntity.ObjectId (not gis objectId).

    • updateXY: boolean = true

      Update WorkOrder xy after removing entities, default is true.

    Returns Promise<unknown>

  • Reopen closed WorkOrders

    Returns

    Returns object that represents a collection of WorkOrders

    Parameters

    • workOrderIds: number[]

      An array of the IDs to reopen the matched WorkOrders

    Returns Promise<unknown>

  • Uncancel workorders

    Returns

    Returns object that represents a collection of workorders

    Parameters

    • workOrderIds: number[]

      An array of the IDs to uncancel the matched workorders

    Returns Promise<unknown>

  • Update a WorkOrder

    Returns

    Returns Promise that represents an object describing the updated workorder

    Parameters

    • wo_data: Object

      See /{subdirectory}/apidocs/#/data-type-infodataType=WorkOrder on the Cityworks instance

    Returns Promise<unknown>

  • Update a WorkOrder entity

    Returns

    Returns object that represents a list of entities removed.

    Parameters

    • workOrderSId: string | number

      The workorder S/ID which the entities should be added to. # for SID, string for ID.

    • entityInfo: Object

      Entity info object including: (req) EntityType: {string}, (req) EntityUid: {string}, Facility_Id: {string}, Level_Id: {string}

    • workComplete: boolean = false

      Update WorkOrder completeness, default is true.

    Returns Promise<unknown>

  • Update Map Layer Fields

    Returns

    Returns Promise that represents a ...

    Parameters

    • workOrderSId: string

      The workorder S/ID to get the map layer fields for.

    • Optional x: number
    • Optional y: number
    • Optional domainId: number

      Should include WKT or WKID attribute. Can also include VcsWKID attribute.

    • Optional z: number

      Optional Z coordinate

    Returns Promise<unknown>