snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.84k stars 3.13k forks source link

Micorosft Teams channels integration #10972

Open cringerjs opened 2 years ago

cringerjs commented 2 years ago

Snipe-IT Version

v5.4.3

Operating System

Ubuntu

Web Server

Nginx

PHP Version

PHP 8.0.18

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Project currently has Slack integration. While Slack is a commonly used application there are others out there that are commonly being used such as MS Teams.

Describe the solution you'd like A clear and concise description of what you want to happen.

Integration to Microsoft Teams.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

N/A

Additional context Add any other context or screenshots about the feature request here.

N/A

snipe commented 2 years ago

This has come up a few times but we don't currently have a Teams account, so we don't hav a good way to test this feature.

CKurti-MCMTSG commented 1 year ago

This has come up a few times but we don't currently have a Teams account, so we don't hav a good way to test this feature.

Setting up a Dev Sandbox is 100% free.

https://learn.microsoft.com/en-us/office/developer-program/microsoft-365-developer-program-get-started

Set up a Microsoft 365 developer sandbox subscription
Set up a Microsoft 365 developer subscription for building solutions independent of your production environment.

It includes a Microsoft 365 E5 developer sandbox subscription with 25 user licenses. It lasts for 90 days and is free to use for development purposes (coding solutions) only. Commercial transactions, including purchasing paid services, are not supported.

cringerjs commented 1 year ago

Teams just uses a webhook to point to a designated teams channel. I see now, though that when you choose integration you see slack and general webhook as an option. I should be able to pull a teams endpoint and see what options are necessary.

snipe commented 1 year ago

@Godmartinz Can you sign up for a Teams account and confirm that the current generic webhook solution works here?

cringerjs commented 1 year ago

@snipe I looked at this is my teams instance and the Generic Webhook will not suffice. The only thing you we need as a configurable option would be the webhook endpoint. The channel you're posting the notifications on is configured when the endpoint is setup in MS Teams.

new_webhook_overview

new_webhook_permissions

new_webhook_add_to_teams

new_webhook_setup_connector

new_webhook_notifications

new_webhook_final

To send a message through the Incoming Webhook you must post a JSON payload to the webhook URL. This payload must be in the form of a connector card for Microsoft 365 Groups.

I found it easiest to use the messagecardplayground with some of the connector card examples if trying to customize the card layout. However, you can send a JSON payload as simple as

{
    "text": "Hello World"
}

image

Here is another example

{
  "@context": "https://schema.org/extensions",
  "@type": "MessageCard",
  "themeColor": "0072C6",
  "title": "Visit the Outlook Dev Portal",
  "text": "Click **Learn More** to learn more about Actionable Messages!",
  "potentialAction": [
    {
      "@type": "ActionCard",
      "name": "Send Feedback",
      "inputs": [
        {
          "@type": "TextInput",
          "id": "feedback",
          "isMultiline": true,
          "title": "Let us know what you think about Actionable Messages"
        }
      ],
      "actions": [
        {
          "@type": "HttpPOST",
          "name": "Send Feedback",
          "isPrimary": true,
          "target": "http://..."
        }
      ]
    },
    {
      "@type": "OpenUri",
      "name": "Learn More",
      "targets": [
        { "os": "default", "uri": "https://learn.microsoft.com/outlook/actionable-messages" }
      ]
    }
  ]
}

card_results

ghost commented 8 months ago

I certainly hope that we can see some proper Teams integration in the future. I'm finding right now that the content of the incoming Webhook is presented in a way that Teams can't fully interpret, showing a message to say that some asset has been checked in/out, but not showing any info about the asset. I suppose it's somewhat on MS for requiring that any webhooks are presented in "Connector card for Microsoft 365 Groups" format, but it'd be nice to see some more webhook flavour options added in future releases.

image