Skip to content

huynxtb/jenkins-plugins-ms-teams-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Read Me

Microsoft Teams Notifier

Microsoft Teams Notifier provides a bridge between Jenkins and Microsoft Teams through the built-in webhook functionality.

  • Get success and fail messages about your job
  • Link to build artifacts

The purpose

The Jenkins Microsoft Teams Notifier plugin was made to share results of a build to a Microsoft Teams channel using the webhooks that Microsoft Teams provides.

Download

You'll have to manually install the plugin via the advanced tab of your plugin settings. A Jenkins plugin repo build will be available soon.

Usage

This plugin uses the post-build feature to execute a request.

After installing, go to your job's configure section and add the Microsoft Teams Notifier item. Then proceed to enter your webhook URL.

Post-build dropdown with Microsoft Teams Notifier Webhooks selected

There are a few options you can choose from:

  • Webhook URL
  • Advanced:
    • Branch
      • If set, the branch will show up on the Microsoft Teams message.
    • Title
      • If set, the title will show up on the Microsoft Teams message. By default, the title is project name
    • Web URL
      • If set, the web url will show up on the Microsoft Teams message
    • Description
      • If set, the web url will show up on the Microsoft Teams message
    • Time Zone

Advanced tab in the config

Pipeline

Microsoft Teams Notifier supports Jenkins Pipeline. The only required parameter is webhookURL (the URL of the webhook, of course) - but there isn't much point of sending nothing.

Parameters

  • webhookURL (required)
    • The URL of the webhook (pretty self-explanatory) provided by Microsoft Teams (Get Webhook URL here).
  • title (required)
    • The title of the message.
  • result (required)
    • Sets notice message (SUCCESS - green, UNSTABLE - yellow, FAILURE - red, ABORTED - grey).
  • branchName
    • If set, current branch build will show.
  • commitId
    • If set, current commit build will show.
  • description
    • If set, the description will show on the message.
  • webUrl
    • If set, the web url will show on the message.
  • jobLink
    • If set, the job url will show on the message.
  • buildNumber
    • If set, current build number build will show.
  • timeZone

Example

pipeline {
  agent any

  post {
    always {
      	msTeamsNotifier webhookURL: 'YOUR_WEBHOOK_URL', title: JOB_NAME, branchName: GIT_BRANCH, commitId: GIT_COMMIT.substring(0, 7), description: 'This is job test', result: currentBuild.currentResult, webUrl: 'https://www.jenkins.io/', jobLink: BUILD_URL, buildNumber: currentBuild.number, timeZone: 'Asia/Bangkok'
    }
  }
}

Message After Send

The message after send look like:

Message After Send

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published