View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - New Telegram Bot Plugin - Page 2 - ProjeQtOr
 
 

New Telegram Bot Plugin

More
08 Mar 2021 17:04 #7 by Baryhobal
Replied by Baryhobal on topic New Telegram Bot Plugin
Sure,

Here is the modified SqlElement.php and the new TelegramTemplate.php.
Main modifications of SqlElement (from the last I posted) are on lines 5293, 5600 to 5638 and 5705.
Here are the SQL statements I used to modify the database:
INSERT INTO menu (id, name, idMenu, type, sortOrder, level, idle, menuClass, isAdminMenu, isLeavesSystemMenu) VALUES ( 200000000, 'menuTelegramTemplate', 88, 'object', 686, 'ReadWriteAutomation', 0, 'Automation', 0, 0);
 
INSERT INTO navigation (name, idParent, idMenu, idReport, sortOrder) VALUES ('menuTelegramTemplate', 129, 200000000, 0, 21);
 
CREATE TABLE telegramtemplate ( id INT(12) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL, template VARCHAR(500) DEFAULT NULL, idMailable INT(12) DEFAULT NULL COMMENT '12', idType INT(12) UNSIGNED DEFAULT NULL COMMENT '12', idle INT(1) UNSIGNED DEFAULT '0' COMMENT '1', PRIMARY KEY (id), KEY emailtemplateMailable (idMailable) );
 
ALTER TABLE mailtosend ADD idTelegramTemplate INT(12) UNSIGNED DEFAULT NULL;

And the not really needed icons are also attached.
Attachments:
The following user(s) said Thank You: Arkhanje

Please Log in or Create an account to join the conversation.

More
09 Mar 2021 09:08 #8 by babynus
Replied by babynus on topic New Telegram Bot Plugin
Thanks.
Added new files in the ticket for integration on V9.2.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
17 Mar 2021 17:22 #9 by Baryhobal
Replied by Baryhobal on topic New Telegram Bot Plugin
Hello again, quick update
I've nearly finished implementing another feature to the bot. You are now able to create tickets via Telegram. You can define some fields and specify a "Ticket Model" in which you can set default values for frequent similar tickets. I'll post the files when it's completly done

Please Log in or Create an account to join the conversation.

More
02 Apr 2021 21:55 - 02 Apr 2021 21:56 #10 by Baryhobal
Replied by Baryhobal on topic New Telegram Bot Plugin
Update:
I added the possibility to create tickets directly from Telegram and to view information about tickets and activities (can easily be extended to other classes)
  • available commands:
    • /ticket (create a ticket)
    • /afficher (display element info)
    • /stop (stop current command)
    • /report (report a bug)
    • /about (sends info about the bot)
  • /ticket:
    1. Asks the name of the ticket
    2. Display fields that can be set
    3. You can choose a template (more about below) with predefined field values
    4. When you click on "Créer" (create), it prints a summary of the ticket and let you modify or save it
  • Ticket templates:
    • New menu in Automation
    • You can create ticket templates with predefined field values
    • When creating a ticket with the bot, you can choose a template and it will automatically set the values defined in the template
    • Currently available fields for ticket templates:
      • ticket type, project, activity, responsible, urgency, criticality, context (1 and 3, bc we only needed these two)
  • /afficher:
    1. Asks you what type of element you want to view (currently available: Ticket, Activity)
    2. Asks you to select a project, then a potential sub-project, and another potential sub-project (you can of course select just a general project and it will include everything below), only projects with tickets/activities are selectable, I will include (sometime in the future) the possibility to choose between selecting just a project or selecting it plus all its sub-projects
    3. When a project is selected, a list of all the elements of the selected class of that project are displayed, ordered by status and priority (an emoji of the status + an emoji of the priority, if it exists, is added after the name, see below)
    4. When an element is selected, a summary is printed (display fields are defined in the bot script in $elementInfo), similar to the one for when a ticket is created. From there, you can either return to project selection or:
      1. Assign it to yourself (if status = created ("enregistré" in french))
      2. Start work (if status = assigned, it is set to in progress)
      3. Stop work if it is started
  • Status and priority emojis:
    • I just added a field to Statuses and Priorities to set an emoji representing the said stat./prio. (not optimal since I can only use UTF-16 emojis due to some limitations of the database encoding I believe)
    • These emojis are used for notifications and in the list of displayable elements
  • /report:
    • Sends a message to the hardcoded chatId (mine) with details about current status of the bot for the sender user. Not much but it can help debug some problems
That's it ! (I think). I still have some ideas in mind and so does my client (my brother :) ). Though there's still a lot of place for improvement (hardcoded values, repeated blocks, unclear statements, no translations), I'm pretty proud of that bot. I've linked the files for the bot and for the TicketTemplate menu.
To make it work, I also had to insert some lines in the database and create some tables:
  • INSERT INTO menu (id, name, idMenu, type, sortOrder, level, idle, menuClass, isAdminMenu, isLeavesSystemMenu) VALUES ( 200000001, 'menuTicketTemplate', 88, 'object', 694, 'Project', 0, 'Automation', 0, 0);
  • INSERT INTO navigation (name, idParent, idMenu, idReport, sortOrder) VALUES ('menuTicketTemplate', 129, 200000001, 0, 51);
  • CREATE TABLE tickettemplate ( id INT(12) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL, idTicketType INT(12) UNSIGNED DEFAULT NULL COMMENT '12', idProject INT(12) UNSIGNED DEFAULT NULL COMMENT '12', idle INT(1) UNSIGNED DEFAULT '0' COMMENT '1', idContext1 INT(12) UNSIGNED DEFAULT NULL, idContext3 INT(12) UNSIGNED DEFAULT NULL, idActivity INT(12) UNSIGNED DEFAULT NULL COMMENT '12', idUrgency INT(12) UNSIGNED DEFAULT NULL COMMENT '12', PRIMARY KEY (id), KEY ticketTicketType (idTicketType), KEY projectProject (idProject), KEY ticketActivity (idActivity), ticketUrgency (idUrgency) );
And here is my nodered flow:
Attachments:
Last edit: 02 Apr 2021 21:56 by Baryhobal.
The following user(s) said Thank You: remi_heredero

Please Log in or Create an account to join the conversation.

More
06 Apr 2021 11:25 #11 by babynus
Replied by babynus on topic New Telegram Bot Plugin
Hi,

Thanks for your contribution.
I added your post as note on ticket to include it on comlmunity version.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
06 Apr 2021 15:52 #12 by Baryhobal
Replied by Baryhobal on topic New Telegram Bot Plugin
Would it be easier if I created a github repo, so you don't have to do this every time I've made modifications ?

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.085 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.