jenkinsci / office-365-connector-plugin

Office 365 Connector plugin sends jobs status notifications to Microsoft Teams or Outlook
https://plugins.jenkins.io/Office-365-Connector/
Apache License 2.0
89 stars 84 forks source link

Mentioning someone in message #55

Open AlexandarY opened 6 years ago

AlexandarY commented 6 years ago

Hey, I was wondering if you could add an option, where when the message is posted in the MS Teams channel, the person who started the build or the author of the last GIT_COMMIT could be mentioned? Thanks!

damianszczepanik commented 6 years ago

It's working now as you described

jetersen commented 6 years ago

connectors on teams does not support personal mentions. Microsoft has implemented follow channel and connectors can then notify you. https://microsoftteams.uservoice.com/forums/555103-public/suggestions/17022934-notification-for-connectors image

damianszczepanik commented 6 years ago

remark I have information who has started the build. Similar is for the author of the change that triggers the build

jetersen commented 6 years ago

You are missing the points of teams mention, he wants to send notification to some @randomuser

AlexandarY commented 6 years ago

As per @casz, it seems indeed the Cards do not support mention. The use case was in case the build failed, I could use Culprits/Developer to mention them so that if they do not follow the channel, I could get their attention. Maybe in the future, if the @mention feature is added to the Cards, we can look into this again?

HenrikPilz commented 5 years ago

Is there any possibility for this feature to come in near future?

jetersen commented 5 years ago

That is is question you should direct at microsoft @HenrikPilz

damianszczepanik commented 5 years ago

I haven't seen support for that

tayyab23 commented 3 years ago

@damianszczepanik Wondering if this can be re-opened in presence of this doc

I haven't been able to make it work using the existing factDefinitions with at tag around a user like so <at>John Doe</at>

Edit: Looks like the reason why it didn't work is because I needed the user id wrapped around a mention entity

damianszczepanik commented 3 years ago

I guess so

miclefebvre commented 3 years ago

@damianszczepanik is it something that would be available in the near future ? We are migrating from Slack and it's a show stopper for us. We would have to go back to email if not possible.

Also is there a way add some documentation on what factDefinitions is ? It's mentioned in the doc, but I have no idea what it's supposed to do.

tayyab23 commented 3 years ago

@damianszczepanik is it something that would be available in the near future ? We are migrating from Slack and it's a show stopper for us. We would have to go back to email if not possible.

Also is there a way add some documentation on what factDefinitions is ? It's mentioned in the doc, but I have no idea what it's supposed to do.

@miclefebvre I specified items from Status to CTL Url in fact definitions, the card in the notification appears like so image

damianszczepanik commented 3 years ago

I would be happy to accept PR for this and help but not sure when have time for developing this feature from scratch.

Anyway this looks like valuable change!

leonardobsjr commented 3 years ago

@damianszczepanik is it something that would be available in the near future ? We are migrating from Slack and it's a show stopper for us. We would have to go back to email if not possible. Also is there a way add some documentation on what factDefinitions is ? It's mentioned in the doc, but I have no idea what it's supposed to do.

@miclefebvre I specified items from Status to CTL Url in fact definitions, the card in the notification appears like so image

You had any success with Mentions?

Giusti commented 3 years ago

@tayyab23 So did you find a solution / workaround how mentions work for this plugin? I tried using <at>name<at> or <at>group<at> but the info is just displayed as normal text

emmaroberts-nbs commented 3 years ago

This feature would be fantastic. Has anyone made any further progress on this?

ljackiewicz commented 3 years ago

I tried to check out what is needed to be done to implement this feature.

Correct me if I am wrong, but if I understand it correctly, the plugin currently only supports the legacy MessageCard format, and in reference to information from a documentation link sent by @tayyab23, mention support is only available for the newer AdaptiveCard format (since version 1.2).

So in this case, there is a need to change/extend the card format first, before an actual implementing of mention support?

Giusti commented 3 years ago

@ljackiewicz Yes I think you are correct, with the current card format mentions do not seem to be possible atleast I havent found a way to get it working

leonardobsjr commented 3 years ago

Yeah @ljackiewicz that seems to be the case. I actually tried to use the mentions on with the Adaptative format using the whole name or group stuff, but was not successful

Giusti commented 3 years ago

@ljackiewicz I was also kind of confused by @tayyab23 comment, because it sounds like he got it working but not sure, he never answered

I haven't been able to make it work using the existing factDefinitions with at tag around a user like so <at>John Doe</at>

Edit: Looks like the reason why it didn't work is because I needed the user id wrapped around a mention entity

leonardobsjr commented 3 years ago

@ljackiewicz I was also kind of confused by @tayyab23 comment, because it sounds like he got it working but not sure, he never answered

I haven't been able to make it work using the existing factDefinitions with at tag around a user like so <at>John Doe</at>

Edit: Looks like the reason why it didn't work is because I needed the user id wrapped around a mention entity

@Giusti I did wrap - the user name was linked, but the user was never notified. Verifying with devtools I saw that the msteams link generation and the one generated from the cards were different - no idea why

Giusti commented 3 years ago

@leonardobsjr mh sad, may I ask what exactly you did by wrapping it ?

leonardobsjr commented 3 years ago

@leonardobsjr mh sad, may I ask what exactly you did by wrapping it ?

Below is my full testing json:

{
    "type":"message",
    "attachments":[
       {
          "contentType":"application/vnd.microsoft.card.adaptive",
          "contentUrl":null,
          "content":{
                "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
                "type": "AdaptiveCard",
                "version": "1.2",
                "body": [
                    {
                        "type": "TextBlock",
                        "id": "MentionTextBlock",
                        "text": "Mention_Test",
                        "weight": "Bolder",
                        "size": "Medium"
                    },
                    {
                        "type": "ColumnSet",
                        "id": "MentionColumnSet",
                        "columns": [
                            {
                                "type": "Column",
                                "id": "MentionColumn",
                                "width": "stretch",
                                "items": [
                                    {
                                        "type": "TextBlock",
                                        "id": "MentionTextBlock2",
                                        "spacing": "None",
                                        "text": "<at>Testing</at>",
                                        "isSubtle": true,
                                        "wrap": true
                                    }
                                ]
                            }
                        ]
                    }
                ],
                "msteams": {
                    "entities": [
                        {
                            "type": "mention",
                            "text": "<at>Testing</at>",
                            "mentioned": {
                                "id": "29:orgid:8a015a0-170c-41bf-a91e-172cg2d38e2e4",
                                "name": "Testing"
                            }
                        }
                    ]
                }
            }
          }
    ]
 }

This actually generates the link, but it's kinda of a 'fake link' because it's different from what msteams generates and doesn't notify the user. I think that the idea is that the Testing is replaced by the mention generated by msteams.

damianszczepanik commented 3 years ago

Guys, Are aware of that migrating to new adaptive cards means that you need to configure all jobs again? This is because card structure is much different from current one and making sure that migration goes smoothly is quite expensive and risky? All hooks will stop working until jobs will be reconfigured again

leonardobsjr commented 3 years ago

Guys, Are aware of that migrating to new adaptive cards means that you need to configure all jobs again? This is because card structure is much different from current one and making sure that migration goes smoothly is quite expensive and risky? All hooks will stop working until jobs will be reconfigured again

I do, but having the ability to mention someone opens so many possibilities that I believe it’s worth it. Maybe this can be done on a fork of the plug-in tho?

damianszczepanik commented 3 years ago

You do but how about 13k installations https://plugins.jenkins.io/Office-365-Connector/ and a few times more projects that need to be updated

Giusti commented 3 years ago

@damianszczepanik how about adding the adaptive card option instead of changing the existing code? so you could use a different command to use the new adaptive cards includion mentions while the old one would still continue to work?

So everyone that wants to use the new functionality can migrate to the new command / adaptive card An the others can just keep the current implementation

damianszczepanik commented 3 years ago

It is possible, it costs as well :)

LukaSvastVolue commented 2 years ago

any progress here, we would really benefit from this feature FYI @bogomilkruzicvolue

luke-hill commented 2 years ago

Given MSTeams is one of the largest work based chat programs. Tagging someone in a message sent via webhook should be reasonably high up the priority foodchain.

vladi14 commented 1 year ago

any update about that feature ? would be much appreciated.

Talhashahar commented 1 year ago

any update ?

precisioninfinity commented 1 year ago

Following, also looking for this feature. Upvote. Please. Thanks in advance.

voblers commented 3 months ago

Keeping this thread alive in 2024. Any updates?

taylorb-ml commented 1 day ago

Bumping this again, would be great to tag users/groups in our Teams messages