Create Custom JavaScript to Open Change or Incident Records

Service Manager uses the discoveryEvent JavaScript to create CI names and to set the values of required fields when opening change or incident records. Out-of-the-box, the script uses the following default values.

Default values to create a new CI

You can update the createCIName and populateNewCI functions to set the following CI values.

Default values used to create a new CI

CI attribute

Default value defined in discoveryEvent

record.logical_name

System generated ID number

record.assignment

AUTO

record.istatus

Installed

record.os_name

Value in record.operating_system

Default values to create a new change

You can update the populateChange function to set the following change values.

Default values used to create a new change

CI attribute

Default value defined in discoveryEvent

change.category

Unplanned Change

change.reason

Value in reason

change.initial_impact

3

change.severity

3

change.coordinator

Change.Coordinator

change.requested_by

discovery

change.status

initial

Default values to create a new incident

You can update the populateIncident function to set the following incident values.

Default values used to create a new incident

CI attribute

Default value defined in discoveryEvent

incident.category

incident

incident.subcategory

hardware

incident.product_type

missing or stolen

incident.assignment

Hardware

incident.initial_impact

3

incident.severity

3

incident.logical_name

Value of id

incident.site_cateogry

C

incident.contact_name

ANALYST, INCIDENT

incident.affected_item

MyDevices