Home > Enterprise >  Jenkins - how to access parameter for Office 365 Connector (notification webhook)
Jenkins - how to access parameter for Office 365 Connector (notification webhook)

Time:04-07

enter image description here

What is the variable for the Office 365 Connector (notification webhook)?

Other examples of variables that I am able to retrieve:

variable parameter
GIT_COMMIT %GIT_COMMIT%

CodePudding user response:

Jenkins offers certain global variables that you can parameterize in the notification, if you need something more dynamic maybe you can get them at the time of starting the job or in the project that you execute

CodePudding user response:

Adding answer from comment section for more visibility.

The Office 365 Connector plugin is designed to take care of the notification by itself according to your settings, and not for providing information for triggering custom notifications via bat or shell script. Therefore you cannot extract the information from the plugin configuration.

However if you do need the WebHook URL to send notification by yourself and still want to use the Office 365 Connector plugin, you can achieve it by defining a parameter for your job, like WEBHOOK_URL, give it the default value you currently have for the URL, and use it both in the Office 365 plugin and in the script.

enter image description here

Then use it like you did in the bat command and also in the Office 365 plugin:

enter image description here

Bonus: you can now also run the job with a different webhook for testing purposes.

  • Related