Skip to content

Office 365 Connector plugin sends jobs status notifications to Microsoft Teams or Outlook

License

Notifications You must be signed in to change notification settings

KevinM2k/office-365-connector-plugin

 
 

Repository files navigation

Travis Status Shippable Status Popularity

Codacy Badge Coverage Status Vulnerabilities

Office-365-Connector

Office 365 Connector plugin for Jenkins

Plugin is used to send actionable messages in Outlook, Office 365 Groups, and Microsoft Teams.

Screenshots

Jenkins configuration

Configuration

Microsoft Teams

With Jenkins plugin

Teams

With generic webhook connection

Webhook

Microsoft Outlook

Outlook

Jenkins Instructions

  1. Install this plugin on your Jenkins server
  2. Configure it in your Jenkins job and add webhook URL obtained from office 365 connector.

Examples

DSL

job('Example Job Name') {
    description 'Example description'
    configure { project ->
        project / 'properties' << 'jenkins.plugins.office365connector.WebhookJobProperty' {
            webhooks {
                'jenkins.plugins.office365connector.Webhook' {
                    name('Example Webhook Name')
                    url('https://outlook.office.com/webhook/123456...')
                    startNotification(false)
                    notifySuccess(true)
                    notifyAborted(false)
                    notifyNotBuilt(false)
                    notifyUnstable(true)
                    notifyFailure(true)
                    notifyBackToNormal(true)
                    notifyRepeatedFailure(false)
                    timeout(30000)
                    macros(class: 'empty-list')
                }
            }
        }
    }
}

Pipeline properties

pipeline {

    agent any

    options {
        office365ConnectorWebhooks([[
                    startNotification: true,
                        url: 'https://outlook.office.com/webhook/123456...'
            ]]
        )
    }

    stages {
        stage('Init') {
            steps {
                echo 'Starting!'
            }
        }
    }
}

Pipeline step

stage('Upload') {
    steps {
        // some instructions here
        office365ConnectorSend webhookUrl: 'https://outlook.office.com/webhook/123456...',
            message: 'Application has been [deployed](https://uat.green.biz)',
            status: 'Success'            
    }
}

Pipeline post section

pipeline {

    agent any

    stages {
        stage('Init') {
            steps {
                echo 'Hello!'
            }
        }
    }

    post {
        failure {
            office365ConnectorSend webhookUrl: "https://outlook.office.com/webhook/123456...",
                factDefinitions: [[name: "fact1", template: "content of fact1"],
                                  [name: "fact2", template: "content of fact2"]]
        }
    }
}

Documentation

You may find useful below link if you like to contribute and add new feature:

About

Office 365 Connector plugin sends jobs status notifications to Microsoft Teams or Outlook

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.0%
  • HTML 1.0%