cityworks
    Preparing search index...

    Class CustomerCall

    Customer call (caller) methods. This is a subclass of Request: it inherits every request method (getById, create, update, ...) and is available as request.customerCall.

    Customer calls always belong to an existing service request, so the request id is the first argument of the methods that create calls. Customer calls can also be created/updated as part of request.create() and request.update().

    Hierarchy (View Summary)

    Index

    Customer Calls

    • Add a caller to a service request. This always creates a new customer call.

      Parameters

      • requestId: number

        The service request to add the caller to

      • callData: CustomerCallData = {}

        See /{subdirectory}/apidocs/#/data-type-info;dataType=CustomerCallBase on the Cityworks instance. IncidentNum and Employee are ignored.

      Returns Promise<unknown>

      Returns Promise that represents an object describing the newly-created customer call

    • Add and/or update customer calls on a service request. Used by request.create() and request.update(), but usable directly.

      Each call is processed in order:

      • With options.newCall, it is always added as a new customer call (any IncidentNum is ignored).
      • Otherwise, a call containing an IncidentNum updates that customer call.
      • Otherwise, the request's existing customer calls are checked for the same caller: a matching phone number (home, work, cell or other, compared by digits) or email address updates that customer call (the most recent match if several). No match adds a new call.

      Parameters

      Returns Promise<any[]>

      Returns Promise that represents an array of the created/updated customer calls (in the order provided)

    • Delete a customer call

      Parameters

      • incidentNum: number

      Returns Promise<unknown>

      Returns Promise that represents the result of the delete operation

    • Get a customer call by its incident number

      Parameters

      • incidentNum: number

      Returns Promise<unknown>

      Returns Promise that represents an object describing the customer call

    • Get the customer calls for a service request

      Parameters

      • requestId: number

      Returns Promise<unknown>

      Returns Promise that represents a collection of customer calls

    • Get the customer calls for multiple service requests

      Parameters

      • requestIds: number[]

      Returns Promise<unknown>

      Returns Promise that represents a collection of customer calls

    • Get caller questions for customer calls

      Parameters

      • incidentNums: number[]

      Returns Promise<unknown>

      Returns Promise that represents a collection of caller questions

    • Get caller questions for service requests

      Parameters

      • requestIds: number[]

      Returns Promise<unknown>

      Returns Promise that represents a dictionary of RequestId to collection of caller questions

    • Move a customer call's point

      Parameters

      • incidentNum: number
      • x: number
      • y: number
      • projection: { VcsWKID?: string | number; WKID?: string | number; WKT?: string }

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

      • Optionalz: number

        Optional Z coordinate

      Returns Promise<unknown>

      Returns Promise that represents an object describing the updated GISPoint

    • Move customer calls from one service request to another

      Parameters

      • fromRequestId: number
      • toRequestId: number
      • incidentNums: number[]

        The customer calls to move

      Returns Promise<unknown>

      Returns Promise that represents the result of the move operation

    • Update an existing customer call

      Parameters

      • incidentNum: number

        The IncidentNum of the customer call to update

      • callData: CustomerCallData = {}

        The fields to update. See /{subdirectory}/apidocs/#/data-type-info;dataType=CustomerCallBase on the Cityworks instance.

      Returns Promise<unknown>

      Returns Promise that represents an object describing the updated customer call

    Other

    admin?: any

    Request Administration methods

    attachments: any

    Attachments methods

    audit: any

    Request audit log methods

    comment: any

    Request Comments methods

    costs: any

    Request Costing methods

    customerCall: any

    Customer call (caller) methods

    Request Categorization

    • Get a list of problem nodes for a domain

      Parameters

      • domainId: number

        The domain ID for which to retrieve problem nodes.

      • viewOnly: boolean = false

        Return only view only problem nodes. Defaults to false.

      • OptionaldisplayMode: Object

        Object that should contain two properties if you provide it: DisplayTextMode: string (C = Code, D = Description, CD = Code ~ Description). DisplayTextDelimeter: string, only impacts CD display text mode.

      • includeCancelled: boolean = false

        Return only cancelled problem nodes as well. Defaults to false.

      Returns Promise<unknown>

      Returns Promise that represents a collection of problem node objects.

    Request Object Search

    • Get the records on the basis of RequestId, only populates RequestId, Description, ProblemCode properties

      Parameters

      • requestId: string

        ???, see instance docs: /{subdirectory}/apidocs/#/service-info/Ams/ServiceRequest

      Returns Promise<unknown>

      Returns Promise that represents a collection of the matching (limited) request objects

    Request Options

    • Get custom field templates for problem code

      Parameters

      • problemSid: number

        The problemSid whose template custom fields should be returned

      Returns Promise<unknown>

      Returns Promise that represents a collection of custom fields

    • Get a list of possible DispatchTo values

      Parameters

      • domainId: number

        Domain to return possible dispatchTo values for

      Returns Promise<unknown>

      Returns Promise that represents an Array of dispatchTo options.

    • Get a list of possible Employee values

      Parameters

      • listType: string

        Which list (endpoint) to get. Includes only DispatchTo & SubmitTo.

      • domainId: number

        Domain to return possible dispatchTo values for

      Returns Promise<unknown>

      Returns Promise that represents an Array of Employee options.

    • Get a list of a problem code's priorities

      Parameters

      • problemSid: number

        Return priorities for given problemSid

      Returns Promise<unknown>

      Returns Promise that represents an Array of priorities

    • Get problem leaf (template) by Sid

      Parameters

      • problemSid: number

        Return problem leaf for given problemSid

      Returns Promise<unknown>

      Returns Promise that represents an Object that describes the problem leaf (template)

    • Get a list of problem codes

      Parameters

      • forPublicOnly: boolean = false

        Return only publicly-available service requests. Defaults to false.

      • onlyActiveTemplates: boolean = true

        Return only active templates. Defaults to true.

      • OptionaldomainIds: number[]

      Returns Promise<unknown>

      Returns Promise that represents an Array of problem name objects.

    • Get a list of problem codes by keywords

      Parameters

      • keywords: string

        Keywords to search for potential problem codes

      Returns Promise<unknown>

      Returns Promise that represents an Array of problem name objects.

    • Get the questions and answer options for a problem code

      Parameters

      • problemSid: number

        The problemSid whose Q&A should be returned

      Returns Promise<unknown>

      Returns Promise that represents a collection of questions and answer settings

    • Get a list of default statuses

      Parameters

      • domainIds: number[]

        List of domains to return default statuses for

      Returns Promise<unknown>

      Returns Promise that represents an Array of statuses.

    • Get a list of possible SubmitTo values

      Parameters

      • domainId: number

        Domain to return possible submitTo values for

      Returns Promise<unknown>

      Returns Promise that represents an Array of submitTo options.

    • Get street codes

      Returns Promise<unknown>

      Returns Promise that represents an Array of Street Codes.

    Request Search

    • Search for requests

      Parameters

      • searchData: Object

        The search information to retrieve matched requests, see instance docs: /{subdirectory}/apidocs/#/service-info/Ams/ServiceRequest

      Returns Promise<unknown>

      Returns Promise that represents an Array of the matching request IDs

    Request Templates

    • Create a search definition. Save the definition by setting SaveDefinition = true and supplying a SearchName.

      Parameters

      • searchData: Object

        Search data variables. See /{subdirectory}/apidocs/#/service-info/Ams/ServiceRequestTemplate

      • OptionalsearchName: string

        What to name your search (if it should be saved)

      • OptionalsharedWithin: number

        What group or domain to share the search to.

      • saveDefinition: boolean = true

        Whether or not to save the search definition. Defaults to true when a search name is specified.

      Returns Promise<unknown>

      Returns Promise that represents a collection of Cityworks Metadata Objects. See: /{subdirectory}/apidocs/#/data-type-info;dataType=CWMetadata

    • Get the questions and answers for a(many) request template(s)

      Parameters

      • problemSids: number[]

        An array list of problemSids to retrieve templates for

      • OptionalminimumDateModified: Date
      • OptionalmaximumDateModified: Date

      Returns Promise<unknown>

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

    • Get request templates (problem leaf[s])

      Parameters

      • OptionaltemplateIds: number[]

        Array of specific template IDs to retrieve

      • canCreate: boolean = false

        If true, only return templates the user can create, ignored if false or null, default is false

      • includeInactiveIf: boolean = false

        If true, returns inactive templates, default is false

      • OptionalminimumDateModified: Date

        ?

      • OptionalmaximumDateModified: Date

        ?

      Returns Promise<unknown>

      Returns Promise that represents a collection of Problem Leafs. See /{subdirectory}/apidocs/#/data-type-info;dataType=ProblemLeaf

    • Get a list of templates

      Parameters

      • problemSids: number[]

        An array list of problemSids to retrieve templates for

      • OptionalminimumDateModified: Date

        ?

      • OptionalmaximumDateModified: Date

        ?

      Returns Promise<unknown>

      Returns Promise that represents

    • Get WorkOrder templates that are associated to this request template type

      Parameters

      • problemSids: number[]

        An array list of problemSids to retrieve Problem WO templates for

      • includeInactive: boolean = false

      Returns Promise<unknown>

      Returns Promise that represents a collection of Problem WO Templates. See /{subdirectory}/apidocs/#/data-type-info;dataType=ProblemWOTemplate

    • Get a list of template id results for a provided search parameters

      Parameters

      • searchData: Object

        Search data variables. See /{subdirectory}/apidocs/#/service-info/Ams/ServiceRequestTemplate

      Returns Promise<unknown>

      Returns Promise that represents a list of template IDs.

    Requests

    • Cancel requests

      Parameters

      • requestIds: number[]

        An array of the IDs to cancel the matched requests

      • OptionalcancelReason: string

        A reason for cancelling the request(s)

      • OptionaldateCancelled: Date

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

      Returns Promise<unknown>

      Returns object that represents a collection of requests

    • Change custom field category for provided requests

      Parameters

      • requestIds: number[]

        The RequestIds whose custom fields should be returned

      • categoryId: number

        The new custom field grouping/category which should be assigned to the provided requests

      Returns Promise<unknown>

      Returns Promise that represents a collection of requests

    • Change a request's problem code

      Parameters

      • requestId: number

        The request ID to change

      • problemSid: number

        The request's new ProblemSID

      Returns Promise<unknown>

      Returns Promise that represents an object describing the updated request

    • Close requests

      Parameters

      • requestIds: number[]

        An array of the IDs to close the matched requests

      Returns Promise<unknown>

      Returns object that represents a collection of requests

    • Create new requests, optionally adding one or more callers once the request exists

      Parameters

      Returns Promise<unknown>

      Returns Promise that represents an object describing the newly-created request. When customer calls are provided, the object also has a CustomerCalls array of the created calls.

    • Create a search definition. Save the definition by setting SaveDefinition = true and supplying a SearchName.

      Parameters

      • searchData: Object

        Search data variables. See /{subdirectory}/apidocs/#/service-info/Ams/ServiceRequest

      • OptionalsearchName: string

        What to name your search (if it should be saved)

      • OptionalsharedWithin: number

        What group or domain to share the search to.

      • saveDefinition: boolean = true

        Whether or not to save the search definition. Defaults to true when a search name is specified.

      • enableEurl: boolean = true

        Whether or not to enable EURL for the saved search. Defaults to true.

      Returns Promise<unknown>

      Returns Promise that represents a collection of Cityworks Metadata Objects

    • Delete requests

      Parameters

      • requestIds: number[]

        An array of the IDs to delete the matched requests

      Returns Promise<unknown>

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

    • Delete Map Layer Fields

      Parameters

      • requestId: number

        The request ID to delete the map layer fields for.

      Returns Promise<unknown>

      Returns Promise that represents a collection of Objects describing the deleted map layer fields

    • Get the audit log for a specific request

      Parameters

      • requestId: number

        A Request ID to get the audit log for

      Returns Promise<unknown>

      Returns Promise that represents a collection of Cityworks Metadata Objects

    • Get a request by ID

      Parameters

      • requestId: number

        The ID of the request to retrieve

      Returns Promise<unknown>

      Returns Promise that represents an object describing the request

    • Get requests by array of IDs

      Parameters

      • requestIds: number[]

        The request IDs to retrieve

      Returns Promise<unknown>

      Returns Promise that represents a collection of Objects describing the requests

    • Get custom fields for provided requests

      Parameters

      • requestIds: number[]

        The RequestIds whose custom fields should be returned

      Returns Promise<unknown>

      Returns Promise that represents a collection of custom fields

    • Get Map Layer Fields

      Parameters

      • requestId: number

        The request ID to get the map layer fields for.

      Returns Promise<unknown>

      Returns Promise that represents a collection of Objects describing the request map layer fields

    • Move a request's point

      Parameters

      • requestId: number
      • x: number
      • y: number
      • projection: { VcsWKID?: string; WKID?: string; WKT?: string }

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

      • Optionalz: number

        Optional Z coordinate

      Returns Promise<unknown>

      Returns Promise that represents an object describing the updated GISPoint

    • Reopen closed requests

      Parameters

      • requestIds: number[]

        An array of the IDs to reopen the matched requests

      Returns Promise<unknown>

      Returns object that represents a collection of requests

    • Uncancel requests

      Parameters

      • requestIds: number[]

        An array of the IDs to uncancel the matched requests

      Returns Promise<unknown>

      Returns object that represents a collection of requests

    • Update a request, optionally adding or updating callers on it

      Each customer call containing an IncidentNum updates that existing call. Otherwise, if the request already has a customer call with a matching phone number or email address, that call is updated. Otherwise a new call is added. To record the same caller phoning in again about this request, pass {newCall: true} so a new customer call is created instead of the previous one being updated.

      Parameters

      • sr_data: Object

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

      • OptionalcustomerCall: CustomerCallData | CustomerCallData[]

        Customer call data (see CustomerCall.addToRequest). RequestId is filled in for you.

      • Optionaloptions: CustomerCallOptions

        {newCall: true} to add every provided customer call as a new call, ignoring any IncidentNum or matching phone/email

      Returns Promise<unknown>

      Returns Promise that represents an object describing the updated request. When customer calls are provided, the object also has a CustomerCalls array of the created/updated calls.

    • Update Map Layer Fields

      Parameters

      • requestId: number

        The service request ID to get the map layer fields for.

      • coordinates: Coordinates

        Object with X, Y, and optional Z coordinate specified.

      • OptionalproblemsId: number

        Optional. Problem Leaf (template) ID. If provided, the map layer fields will be updated from the service request template (problem leaf) otherwise, only existing updated.

      • OptionaldomainId: number

        Optional. Domain ID of org

      Returns Promise<unknown>

      Returns Promise that represents an object with all the updated GIS info for the request, including a collection of the updated map layer fields