Coder Social home page Coder Social logo

mantis-bt-microsoft-teams's Introduction

Mantis-BT-Microsoft-Teams

A MantisBT plugin to communicate with Microsoft Teams projects and channels via a webhooks.

Setup

  • The master branch requires Mantis 2.0.x

  • Extract this repo to your Mantis folder/plugins/MicrosoftTeams.

  • On the Teams side, create a new Webhook (found in Incomming Webhook) and note the URL that Teams generates for you,see Documentation.

  • On the MantisBT side, access the plugin's configuration page and fill in your Teams webhook URL.

  • You can map your MantisBT projects to other Incoming webhooks by setting the plugin_Teams_url_webhooks option in Mantis. Follow the instructions on the plugin's configuration page to get there. Make sure the plugin_Teams_url_webhooks configuration option is set to "All Users", with type "complex". Example value for this setting:

          array (
            'My First Mantis Project' => 'https://outlook.office.com/webhook/xx/IncomingWebhook/xx',
            'My Second Mantis Project' => 'https://outlook.office.com/webhook/xx/IncomingWebhook/xx'
          )
    
  • You can specify which bug fields appear in the Teams notifications. Edit the plugin_Teams_columns configuration option for this purpose. Follow the instructions on the plugin configuration page.

  • You can map MantisBT usernames to Teams mentions. You can configure it the same way as the other "complex" configurations above. Example value for this setting:

          array (
            'My First Mantis Project' => 'https://outlook.office.com/webhook/xx/IncomingWebhook/xx',
            'My Second Mantis Project' => 'https://outlook.office.com/webhook/xx/IncomingWebhook/xx'
          )
    

Forked

This is a modified version of the Slack Plugin made by Karim Ratib and adapted for Teams by Hamdi Amine.

mantis-bt-microsoft-teams's People

Contributors

hamdi-amine avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mantis-bt-microsoft-teams's Issues

Unknown named parameter $files

I get this error when i change the status of an ticket and i write something in the description

Unknown named parameter $files
C:\inetpub\wwwroot\mantisbt\core\event_api.php: 232: - - - - event_callback()
C:\inetpub\wwwroot\mantisbt\core\event_api.php: 164: - - - - event_type_execute()
C:\inetpub\wwwroot\mantisbt\core\bugnote_api.php: 315: - - - - event_signal()
C:\inetpub\wwwroot\mantisbt\bug_update.php: 470: - - - - bugnote_add()

when i just update a ticket without any note message its working good

Error when deleting a mantis or a mantis note

I get a white screen after deleting a bug or a bug note.

I have this error in logs:
PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function MicrosoftTeamsPlugin::notify(), 4 passed in [....]/plugins/MicrosoftTeams/MicrosoftTeams.php on line 170 and exactly 5

I try to send a PR as soon as possible

wrong link to mantislogo

Hey i found another bug in line 333 you link to an "old" path of the repository
The old one
$payload['icon_url'] = 'https://raw.githubusercontent.com/infojunkie/MantisBT-MicrosoftTeams/master/mantis_logo.png';
have to change in
$payload['icon_url'] = 'https://raw.githubusercontent.com/Hamdi-Amine/Mantis-BT-Microsoft-Teams/master/mantis_logo.png';

Wrong folder

Hi,

Just to let you know that the install procedure is misleading :

  • Extract this repo to your Mantis folder/plugins/Teams.

Should be :

  • Extract this repo to your Mantis folder/plugins/MicrosoftTeams.

Regards

error "APPLICATION ERROR #0: " (Hook looks to return "1" instead of "OK")

Hello,

I get an error after calling the Teams hook: Teams is welly updated but Mantis show this error:
APPLICATION ERROR #0:

$result contain "1" instead of "OK" at this line:

if ($result !== 'ok') {

The error message show that curl does not detect any error (curl_errno($ch) . ': ' . curl_error($ch) return 0:).

I doesn't know the Teams API but it's looks to return other data than "ok" after calling the hook.
I currently change this line on my side:

$result = curl_exec($ch);
if ($result !== 'ok' and $result !== '1') {
   trigger_error(curl_errno($ch) . ': ' . curl_error($ch), E_USER_ERROR);
   plugin_error('ERROR_CURL', E_USER_ERROR);
}

Everything work after that patch

Plugin only passing 3 params but 5 are required?

Windows Server 2019, IIS, MantisBT 2.24.3

The webhook URL is correct on my system because I can paste it into a browser and get the standard "cannot use GET method" error message. So at least we know the Teams webhook is correct. Below I have mangled the URL for posting purposes. Here is the MantisBT error screen, any ideas on how to start troubleshooting this?

INTERNAL APPLICATION ERROR

Too few arguments to function MicrosoftTeamsPlugin::notify(), 3 passed in C:\MantisBT2243\plugins\MicrosoftTeams\pages\config.php on line 45 and exactly 5 expected

Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
Detailed error information
Full path: C:\MantisBT2243\core\error_api.php
Line number: 92
Stack trace

Filename Line Class Type Function Args

0 C:\MantisBT2243\plugins\MicrosoftTeams\pages\config.php 45 MicrosoftTeamsPlugin -> notify 'Hello, this is a test for the MantisBT-Microsoft Teams plugin ๐Ÿ‘‹', 'https://domain/webhookb2/hash/IncomingWebhook/hash', '#General'
1 C:\MantisBT2243\plugin.php 74 - - include 'C:\MantisBT2243\plugins\MicrosoftTeams\pages\config.php'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.