Incident operations for scripts
The incident operations can be used with any Object Type for the script.
The object contains the incident data and helper methods. The incident data contains only data from incident fields; it does not contain its notes, task, milestones, artifacts, or attachments.
Type incident. to access data from a specific incident field or run a helper method. The field names and helper methods appear in a type-ahead box as you type.
When you change the state of an incident field, use 'C' or
'A' instead of "Closed" or
"Active". For example, use "incident.plan_status = 'C'"
instead of "incident.plan_status = 'Closed'".
The following table describes the helper methods.
| Operation | Description |
|---|---|
|
Adds an artifact to the incident with the provided type, value, and description. Returns an artifact script object for further customization. |
|
Attaches the email attachment to the incident and returns the attachment object to the incident. The returned attachment object can then be acted upon by other script operations. The attachment object that is returned by these operations defines two modifiable fields: filename and content_type. The addEmailAttachment(id) operation uses the email message's
Use the addEmailAttachment(id, filename, content_type) operation to specify
the file name and content_type values. For example, if the |
|
Adds a milestone to the incident with the provided title, description, and date. Returns a Milestone script object for further customization. |
|
Adds a note to the incident with the provided text. Returns a Note script object for further customization. |
|
Adds a row to the named data table on the incident. Returns a Row script object for further customization. |
|
Adds an ad hoc task to the incident with the provided name, phase, and instructions. Returns a Task script object for further customization. |
Script example
oldId = int(row.system_id)
newRow = incident.addRow("infected_systems")
newRow["system_id"] = str(oldId + 1)
newRow["owner_group"] = "HR"