This media type integrates your Zabbix installation with your ((OTRS)) CE installation using the Zabbix webhook feature.

((OTRS)) CE configuration:

1. Create a new web service. To do so, navigate to "Admin" → "Web services" and import the "ZabbixTicketConnector.yml" file (it can be found in the official Zabbix repository next to the media type file).

2. Create a new customer.

3. Create a new customer user. Select the ID of the customer that you created in the previous step.

4. Create a new agent. Depending on the ticket queue you want to use for tickets created by the webhook, set the "RW" permission for the group that this ticket queue belongs to. In the example below, if you want to use the "Misc" queue, you must set the "RW" permission for the group "users".

Zabbix configuration:

1. Before you can start using the ((OTRS)) CE webhook, set the global macro "{$ZABBIX.URL}":
- In the Zabbix web interface, go to "Administration" → "Macros" in the top-left dropdown menu.
- Set the global macro "{$ZABBIX.URL}" to the URL of the Zabbix frontend. The URL should be either an IP address, a fully qualified domain name, or localhost.
- Specifying a protocol is mandatory, whereas the port is optional. Depending on the web server configuration, you might also need to append "/zabbix" to the end of URL. Good examples:
  - http://zabbix.com
  - https://zabbix.lan/zabbix
  - http://server.zabbix.lan/
  - http://localhost
  - http://127.0.0.1:8080
- Bad examples:
  - zabbix.com
  - http://zabbix/

2. Set the following webhook parameters:
- otrs_auth_user - the username of the agent
- otrs_auth_password - the password of the agent
- otrs_customer - the email of the customer user
- otrs_queue - the queue that will be used for tickets created by the webhook
- otrs_url - the frontend URL of your ((OTRS)) CE installation (for example, "https://otrs.example.com/otrs")

3. If you want to prioritize issues according to the severity values in Zabbix, you can define mapping parameters (create them as additional webhook parameters):
- severity_<name> - the ((OTRS)) CE priority ID (<name> in the parameter name can be one of the following values: "not_classified", "information", "warning", "average", "high", "disaster")

4. If you have dynamic fields in ((OTRS)) CE and want them to be filled with values from Zabbix, add webhook parameters in the format "dynamicfield_<((OTRS)) CE dynamic field name>", similarly to the previous step. Dynamic fields can only be of the types "text", "textarea", "checkbox", or "date".

5. If you want the webhook to close tickets related to **resolved** problems in Zabbix, you can change the following parameter value:
- otrs_closed_state_id - ((OTRS)) CE state ID for closed tasks (possible values: 0 - Disable tickets closing, >0 - State ID from the State Management page).

6. If you use the ticket type feature, you can change the type of the created tickets:
- otrs_ticket_type - ((OTRS)) CE ticket type (set to "Unclassified" by default; present on fresh installations).

7. Click the "Enabled" checkbox to enable the mediatype and click the "Update" button to save the webhook settings.

8. Create a Zabbix user and add media:
- To create a new user, go to the "Users" → "Users" section, click the "Create user" button in the top right corner. In the "User" tab, fill in all required fields (marked with red asterisks).
- In the "Media" tab, click "Add" and select the type "OTRS CE" from the drop-down list. Add any value in the "Send to" field: it is not used in the webhook, but is required.
- Make sure this user has access to all hosts for which you would like problem notifications to be sent to ((OTRS)) CE.

9. Done! You can now start using this media type in actions and create tickets.

You can find the latest version of this media and additional information in the official Zabbix repository:
https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/media/otrs_ce