如何在Jenkins pipeline webhook for office365Connector中添加备注、提交人和开发人员

如何在Jenkins pipeline webhook for office365Connector中添加备注、提交人和开发人员,jenkins,groovy,office365connectors,Jenkins,Groovy,Office365connectors,我已经在这样的管道中设置了办公室365连接器。。如何添加自动备注,如 由SCM更改启动或由用户SoAndSo启动。。 以及如何添加提交者和开发人员 post{ success{ office365ConnectorSend( status: "Build Success", webhookUrl: "Url", color: '00ff00', message: "Som

我已经在这样的管道中设置了办公室365连接器。。如何添加自动备注,如 由SCM更改启动或由用户SoAndSo启动。。 以及如何添加提交者和开发人员

post{
  success{
    office365ConnectorSend(
        status: "Build Success",
        webhookUrl: "Url",
        color: '00ff00',
        message: "Some Message"
        )  
      
    }
    failure{
         office365ConnectorSend(
        status: "Build Failed",
        webhookUrl: "UrL",
        color: 'ff4000',
        message: "The build has failed, please check build logs"
        )
    }

}

如果你想@提及某人,office365 jenkins插件仍然无法提供

要获取启动生成的用户,请参见

要获取提交者的电子邮件,请参见此

如果你真的想像我一样提到用户,你可以:

  • 如果你懂java,就创建一个PR,在官方回购协议上解决这个问题

  • 如果您不懂java,或者无法抽出时间,则必须将这些内容整合在一起:

  • 这是您将如何从管道中使用

  • 现在您必须从

  • 在jenkins上将webhook添加为凭据,如下所示:

  • 因此,您可以在管道中调用它:

    office365ConnectorSend message: "Hello", webhookUrl: credentials("wh-msteams-dev")
    
  • 发送,这是目前唯一支持提及的类型,以下是文档中的示例:
  • {
    “contentType”:“application/vnd.microsoft.card.adaptive”,
    “内容”:{
    “类型”:“AdaptiveCard”,
    “正文”:[
    {
    “类型”:“文本块”,
    “文本”:“你好,约翰·多伊”
    }
    ],
    “$schema”:”http://adaptivecards.io/schemas/adaptive-card.json",
    “版本”:“1.0”,
    “MST团队”:{
    “实体”:[
    {
    “类型”:“提及”,
    “文本”:“约翰·多伊”,
    “提及”:{
    “id”:“29:123124”,
    “姓名”:“约翰·多伊”
    }
    }
    ]
    }
    }
    }
    
    不,这不是小事

    是的,我也为这句话的糟糕程度感到痛苦

    失望,但并不惊讶。这毕竟是微软的团队

    请相信我

    {
      "contentType": "application/vnd.microsoft.card.adaptive",
      "content": {
        "type": "AdaptiveCard",
        "body": [
          {
            "type": "TextBlock",
            "text": "Hi <at>John Doe</at>"
          }
        ],
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.0",
        "msteams": {
          "entities": [
            {
              "type": "mention",
              "text": "<at>John Doe</at>",
              "mentioned": {
                "id": "29:123124124124",
                "name": "John Doe"
              }
            }
          ]
        }
      }
    }