Notifications from ManageEngine Service Desk tickets to telegram chats and personal notifications about replies with SOCKS proxy support
Sending messages to group chat with short info about new ticket:
Personal notifications of new replies:
Scripts is designed to work with Python 2.7 (sorry, no Python 3 support). You can check which version you have by running:
python -V
>Python 2.7.14
You also need install additional modules, this is required for operation.
pip install requests
pip install pysocks
Scripts uses Telegram's User IDs(UID) to send messages, not @-style username(but username is still used to tag technician in group chat). To get your (or chat) UID, send /start message to bot and check content of this page:
https://api.telegram.org/bot<bot token>/getUpdates
You will get something like this:
{"ok":true,"result":[{"update_id":XXXXXXXX,
"message":{"message_id":8,"from":{"id":YYYYYY,"first_name":"Kostya","last_name":"Belykh","username":"belykh_k"},"chat":{"id":YYYYYY,"first_name":"Kostya","last_name":"Belykh","username":"belykh_k","type":"private"},"date":1491057143,"text":"asd"}}]}
Part "id":YYYYYY
is what you needed. Note that Chat ID will contain -
at begining, do not discard it.
- Clone repo to your local machine
git clone https://github.com/belykhk/sd-telegram-notify
-
Copy
settings-example.py
tosettings.py
and editsettings.py
for youself -
Put
Posttotg.py
,Posttotgpersonal.py
andsettings.py
to
{ManageEngineSDInstallDir}/integration/custom_scripts/
- Edit your settings in Service Desk in Custom scripts menu. Something like that:
Send message to group chat then ticket is created:
Send personal message then reply from author received:
You can find additional info here (Russian).