4.5.3.2 Ticket statuses
The ticket statuses can be customized as follows.
- Changing status names
- Changing the initial status and transition order of statuses
- Adding and deleting statuses
(1) Changing status names
To change status names, edit the JavaScript file and JSON Schema file.
■JavaScript file
Change the status name enclosed in double quotation marks (") in the following files.
(Table) Sections to edit in the JavaScript file
| JavaScript file | Location | Description |
|---|---|---|
| script/ticket-common/ticket_mapping_definition.js | LABELS
|
ClientScript* |
<Definition example>
DISPLAY_STATUS: {
NEW: "New",
CLOSED: "Closed",
IN_PROGRESS: "In Progress",
CANCELED: "Cancelled",
PENDING: "Pending",
RESOLVED: "Resolved",
AWAITING_APPROVAL: "Awaiting Approval",
PLANNING: "Planning",
COMPLETED: "Completed",
OPEN: "Open",
DECLINED: "Declined",
AWAITING_IMPLEMENTATION: "Awaiting Implementation",
AWAITING_BACKOUT: "Awaiting Backout",
CLOSED_WITH_BACKOUT: "Closed With Backout",
IMPLEMENTING: "Implementing",
INVESTIGATING: "Investigating",
}
■JSON Schema file
Change the status name enclosed in double quotation marks (") in the following files.
(Table) Sections to edit in the JSON Schema file
| JSON Schema file | Location | Description |
|---|---|---|
| datamodel/otobo-datasource-schemas/display-type-status.json |
|
File related to multiple APIs |
| datamodel/datamodels_for_ticket_detail_ui/filter-form-schema.json |
|
File related to UI |
<Definition example>
"displayStatus": {
"type": "string",
"enum": [
"New",
"Open",
"Declined",
"Awaiting Approval",
"Awaiting Implementation",
"Pending",
"Planning",
"In Progress",
"Resolved",
"Completed",
"Closed",
"Cancelled",
"Awaiting Backout",
"Closed With Backout",
"Implementing",
"Investigating"
]
}
(2) Changing the initial status and transition order of statuses
The initial status and transition order of statuses vary depending on the ticket type. You can also customize the statuses for each ticket type. For details on the existing settings for statuses by ticket type, refer to the status for each type from the references in the “Ticket types”.
Edit the following file.
■JavaScript file
(Table) JavaScript files that need to be edited
| JavaScript file | Location | Description |
|---|---|---|
| script/ticket_operation/ticket_type_state_definition/ticket_type_state_definition.js |
|
ClientScript* |
[“TYPE_INIT_STATE_MAP”: initial status]
The initial status for each type is set in format of [TICKET_STATE.status definition name]. If you want to change it, select from the status definition names defined in “TICKET_STATE”.
<Definition example>
const TYPE_INIT_STATE_MAP = {
incident: [TICKET_STATE.OPEN],
problem: [TICKET_STATE.OPEN],
rfc: {
normal: [TICKET_STATE.OPEN],
breakfix: [TICKET_STATE.OPEN],
emergency: [TICKET_STATE.OPEN],
standard: [TICKET_STATE.OPEN],
},
task: [TICKET_STATE.NEW],
case: [TICKET_STATE.OPEN],
release: [TICKET_STATE.OPEN],
request: [TICKET_STATE.OPEN],
unclassified: [TICKET_STATE.OPEN],
};
In this case, the initial status for incident tickets is “open”.
["type name_NEXT_STATES_MAP": transition destination status]
Define the status to transition to for each type with “type name_NEXT_STATES_MAP”.
In the type name, enter INCIDENT, REQUEST, TASK, PROBLEM, RELEASE, CASE, and UNCLASSIFIED.
[Source status]: Set using the [transition destination status] format. If you want to change the source status, change the transition destination status. When setting multiple transition destination statuses, separate them using commas.
<Definition example (incident tickets)>
const INCIDENT_NEXT_STATES_MAP = {
[TICKET_STATE.OPEN]: [
TICKET_STATE.OPEN,
TICKET_STATE.IN_PROGRESS,
TICKET_STATE.PENDING,
TICKET_STATE.CANCELLED,
TICKET_STATE.COMPLETED,
],
[TICKET_STATE.IN_PROGRESS]: [
TICKET_STATE.IN_PROGRESS,
TICKET_STATE.PENDING,
TICKET_STATE.CANCELLED,
TICKET_STATE.COMPLETED,
],
[TICKET_STATE.PENDING]: [
TICKET_STATE.PENDING,
TICKET_STATE.IN_PROGRESS,
TICKET_STATE.CANCELLED,
],
[TICKET_STATE.CANCELLED]: [TICKET_STATE.CANCELLED, TICKET_STATE.CLOSED],
[TICKET_STATE.COMPLETED]: [
TICKET_STATE.COMPLETED,
TICKET_STATE.IN_PROGRESS,
TICKET_STATE.CLOSED,
],
[TICKET_STATE.CLOSED]: [TICKET_STATE.CLOSED],
};
In this case, if the status is “open”, open, in_progress, pending, cancelled and completed are displayed as the next statuses.
The transition destination status of rfc tickets can be set for each of the change types normal, breakfix, emergency, and standard, as with the initial status.
<Definition example (rfc tickets)>
const RFC_NEXT_STATES_MAP = {
normal: {
[TICKET_STATE.OPEN]: [
TICKET_STATE.OPEN,
TICKET_STATE.PLANNING,
TICKET_STATE.CANCELLED,
],
(omitted)
[TICKET_STATE.CANCELLED]: [TICKET_STATE.CANCELLED, TICKET_STATE.CLOSED],[TICKET_STATE.CLOSED]: [TICKET_STATE.CLOSED],
},
breakfix: {
[TICKET_STATE.OPEN]: [
TICKET_STATE.OPEN,
TICKET_STATE.PLANNING,
TICKET_STATE.CANCELLED,
],
(omitted)
[TICKET_STATE.CANCELLED]: [TICKET_STATE.CANCELLED, TICKET_STATE.CLOSED],[TICKET_STATE.CLOSED]: [TICKET_STATE.CLOSED],
},
emergency: {
[TICKET_STATE.OPEN]: [
TICKET_STATE.OPEN,
TICKET_STATE.PLANNING,
TICKET_STATE.CANCELLED,
],
(omitted)
[TICKET_STATE.CANCELLED]: [TICKET_STATE.CANCELLED, TICKET_STATE.CLOSED],[TICKET_STATE.CLOSED]: [TICKET_STATE.CLOSED],
},
standard: {
[TICKET_STATE.OPEN]: [
TICKET_STATE.OPEN,
TICKET_STATE.AWAITING_IMPLEMENTATION,
TICKET_STATE.CANCELLED,
],
(omitted)
[TICKET_STATE.CANCELLED]: [TICKET_STATE.CANCELLED, TICKET_STATE.CLOSED],[TICKET_STATE.CLOSED]: [TICKET_STATE.CLOSED],
},
};
(3) Adding and deleting statuses
[Adding new statuses]
You can add new statuses separate from the statuses prepared by default in Ops I. The procedure for adding a status is shown below.
- Adding statuses to OTOBO
- Open OTOBO from the contents area of the ITSM application.
- Select [Admin] on the main menu.
- Click [Ticket Settings] - [States] to open the [State Management] window.
- Select [Actions] - [Add State].
- Enter the following in the [Add State] window and click the [Save] button.
- Name: OTOBO status variable name
The number of characters allowed is between 1 and 191. - State type:
For details, see the following.
https://doc.otobo.org/manual/admin/11.0/en/content/administration-area/ticket-settings/states.html - Validity:
Set "valid".
- Name: OTOBO status variable name
- Adding statuses to Ops I
Define the following variables in the JavaScript file and JSON Schema file, and set the relationships.- Status variable name: Value used in JavaScript
Any unique name can be used in JavaScript. Define it in "ticket_type_state_definition.js". - Ops I status variable name: Unique value indicating the status on the Ops I side
Used in API input/output and scripts. Define it in "ticket_type_state_definition.js". - Ops I status label: Display name on the Ops I GUI
Define it in "ticket_field_definition.js".
■JavaScript fileJavaScript file Location Description script/ticket_operation/ticket_type_state_definition/ticket_type_state_definition.js - TICKET_STATE
Set the relationship between the status variable name and Ops I status variable name - closeStatusSet
Add when the status type is "closed"
ClientScript* script/ticket-common/ticket_mapping_definition.js - OTOBO_MAPPING_STATE
Set the relationship between the Ops I status variable name and OTOBO status variable name - LABELS.DISPLAY_STATUS
Set the relationship between the status variable name and Ops I status label name - OTOBO_MAPPING_DISPLAY_STATUS
Set the relationship between the Ops I status label name and OTOBO status variable - STATE_DISPLAY_STATUS_MAP
Set the relationship between the Ops I status variable name and Ops I status label
ClientScript* *For details on ClientScript, see "UI design".
■JSON Schema file
Add the Ops I status variable name to the section to edit.JSON Schema file Location Description datamodel/datamodels_for_ticket_detail_ui/filter-form-schema.json - properties.state.enum
Add Ops I status variable name - properties.displayStatus.enum
Add Ops I status label name
File related to UI datamodel/otobo-datasource-schemas/create-ticket-request-capi.json - properties.state.enum
Add Ops I status variable name
File related to POST /capi/v1/tickets datamodel/otobo-datasource-schemas/ticket-search-response.json - properties.content.items.allOf.properties.state.enum
Add Ops I status variable name
File related to GET /capi/v1/tickets datamodel/otobo-datasource-schemas/ticket.json - allOf.properties.state.enum
Add Ops I status variable name
File related to multiple APIs datamodel/otobo-datasource-schemas/update-ticket-request-capi.json - properties.state.enum
Add Ops I status variable name - properties.approvalFlows.items.properties.status.enum
Add Ops I status variable name
File related to PUT /capi/v1/tickets/{id} datamodel/otobo-datasource-schemas/update-ticket-request-patch.json - properties.state.enum
Add Ops I status variable name
File related to PATCH /capi/v1/tickets/{id} datamodel/otobo-datasource-schemas/ticket-settings-approval.json - properties.statuses.items.properties.approval.enum
Add Ops I status variable name - properties.statuses.items.properties.transition.properties.approved.enum
Add Ops I status variable name - properties.statuses.items.properties.transition.properties.declined.enum
Add Ops I status variable name
File related to POST /capi/v1/ticket-settings/approval or PUT /capi/v1/ticket-settings/approval/{id} - Status variable name: Value used in JavaScript
[Deleting statuses]
Delete unnecessary statuses from the JSON Schema file to be edited when adding statuses.