Skip to content

fsh1ne/GLPI-MAX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MAX Bridge — GLPI plugin that forwards ticket events to an external bot

English | Русский

A tiny plugin (2 files, ~200 lines of PHP) that sends HTTP POST requests with JSON ticket events to your endpoint — for example, a MAX messenger bot — using GLPI item_add / item_update hooks.

Why, when GLPI 11 has native webhooks

The webhook subsystem in GLPI 11.0.x is unreliable: events originating from cron contexts (mail collector, automatic actions) and from child objects (followups, solutions) are sometimes never delivered. Plugin hooks have been a stable API since 9.x and fire for every event source: web UI, e-mail, REST API, forms, bulk actions.

Events

Hook Condition item_type / event
Ticket item_add always Ticket / new
Ticket item_update only when status changed Ticket / update
ITILFollowup item_add tickets only (itemtype=Ticket) Followup / new
ITILSolution item_add tickets only (itemtype=Ticket) Solution / new

Payload format

Ticket (new / update):

{"item_type": "Ticket", "event": "new", "ticket_id": 123,
 "name": "Subject", "status": 1, "status_name": "Новая",
 "entity_name": "Organization",
 "date_creation": "2026-07-03 10:00:00", "date_solve": ""}

Followup:

{"item_type": "Followup", "event": "new", "content": "<p>Text</p>",
 "is_private": 0, "user_name": "login", "ticket_id": 123,
 "ticket_name": "Ticket subject"}

Solution:

{"item_type": "Solution", "event": "new", "content": "<p>Text</p>",
 "user_name": "login", "ticket_id": 123}

Notes:

  • user_name is the GLPI login; the receiver can resolve the full name via REST API.
  • content is HTML with entities already decoded (&quot;").
  • status_name uses a built-in Russian label map — adjust plugin_maxbridge_status_name() in hook.php for another locale (the numeric status field is locale-independent).

Installation

  1. Unpack into glpi/plugins/maxbridge/
  2. Set your endpoint URL in the PLUGIN_MAXBRIDGE_URL constant (top of setup.php)
  3. GLPI → Setup → Plugins → MAX Bridge → Install → Enable

Configuration

All parameters are constants at the top of setup.php: endpoint URL and connect/request timeouts. Timeouts are short (2/3 s) so ticket saving is not slowed down when the receiver is unavailable.

Troubleshooting

Delivery errors are logged to glpi/files/_log/maxbridge.log.

Compatibility

Tested on GLPI 11.0.4 (PHP 8.2+). Declared range: min 10.0 / max 12.0.

Changelog

  • 1.0.1ticket_name field in followup payloads (readable notifications)
  • 1.0.0 — initial release

Author

fsh1ne

License

GPL-2.0-or-later

About

GLPI plugin: send ticket events to MAX messenger bot via webhooks / Плагин GLPI для интеграции с мессенджером MAX

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages