Jenkins 2.3.5 Build Notification (Emailext, bitbucket build status notifier) Not Working - jenkins

We recently rebuilt our Jenkins server and we are using Jenkins 2.3.5/JDK8/ubuntu 14.04/bitbucket cloud/hipchat cloud.
After we got the newly built Jenkins server running, everything worked except for the build result notification.
We used to get the bitbucket account that we used with Jenkins to comment on the build result, so we can receive it in the hipchat room, even without using hipchat notification plugin. Now, we have tried the emailext plugin, Bitbucket Build Status Notifier Plugin, but none of them worked. It seems that the plugin is all out of date in terms of configurations.
For emailext, it complains "An attempt to send an e-mail to empty list of recipients, ignored." But we put a number of email in the "Default Recipients". And all the SMTP settings are correct since we can receive testing message.
For Bitbucket Build Status Notifier Plugin, I followed here, but I couldn't find the "Bitbucket notify build status" in the job configure.
Any suggestions would be appreciated.

Use Extended Email notification plugin, set SMTP server in Jenkins global configuration

Related

Email no longer sent after jenkins job execution

On a Ubuntu, I have a Jenkins service setup with Email-EXT plugin, where I have setup jobs executed regularly, and emails are being sent after the job execution. But just recently, I no longer receive any emails after the job execution.
Details:
In each job execution "console output", it is said that Email has been triggered.
And I was able to use the "Test configuration by sending test e-mail"
on Jenkins/"configure system" page" to send out the testing email.
Based on my company rule, I had the password changed just recently.
And I did the some update on jenkins/configure page as well.
jenkins version 2.176.1
EMAIL-EXT plugin version: 2.69
So what could be wrong for not receiving emails ????
In my case, there is nothing wrong with the jenkins side settings. I have switched the smtp server to user the gmail one, and it works. It must be some policy change on my company smtp server side.
BTW, to turn on the debug mode of the trigger gives some direction to my case.

BitBucket Webhook - Unable to connect to Jenkins URL

I am trying to create a webhook in BitBucket to trigger a build in Jenkins, but when I enter my Jenkins URL, and I test the connection, I get the error "Unable to connect to the URL specified, check the host and port are correct." I am using the URL http://localhost:8080/bitbucket-hook/ (with the last back slash included) and I can confirm that in Jenkins, my "Jenkins URL" is set to http://localhost:8080/. In Jenkins, I have installed the plugin "BitBucket Server Integration", and under Configure System -> Bitbucket Server Integration, I have connected to the Bitbucket server (and when I test the connection, it says "Jenkins can connect with the Bitbucket Server", so I am pretty sure Jenkins is configured correctly). I don't have credentials set up in Jenkins for the Bitbucket Server configuration, is this necessary even though when I test the connection, it seems to be able to connect? Is my url for the BitBucket webhook correct?? Is there anything else you can think of that I might not have configured correctly so when I test the connection on BitBucket, it will connect properly?
I just ran through a similar setup, to answer to your questions:
yes, I think you will have to use credentials of a user having admin permissions on the repository upon which you want to create the webhook.
Read below, anyway the Webhook URL I got is in the form < jenkins-url >/bitbucket-server-webhook/trigger
The pipeline
According to my experience, the creation of the Webhook is demanded to Jenkins, you don't have to do anything on your own other than creating a new Pipeline object.
Having set the Bitbucket Server Integration configuration up in fact is not enough for the creation of the Webhook, to do that you have to
create a new Pipeline
flag the Build Trigger "Bitbucket Server trigger build after push"
in the Pipeline section, use as Definition "Pipeline Script from SCM" and fill the other fields according to the configuration you have set before.
Point 3 is saying you are retrieving your Pipeline definition from a file stored in Bitbucket itself, you can also customise the name of the file Jenkins is going to look for (by default this should be Jenkinsfile), and use the "Pipeline Syntax" option to get the snippet of code you will use as step in your Jenkinsfile.
Once you have created your Pipeline in Jenkins, the webhook should appear in the right section in your Bitbucket Server repository.

integrating gitlab with jenkins using webhooks does not work

I am trying to trigger jenkins pipeline on gitlab push to branch and tag.
Using Jenkins ver. 2.176.2 and gitlab version 10.7.3-ee.
Although I have supposedly set up the webhooks properly, I do not see the jenkins job being triggered.
I have installed the gitlab plugin for jenkins, and configured the gitlab server, including the Personal Access Token for GitLab APIs access generated in gitlab.
I have defined the webhook (currently requesting trigger on all events). (for testing, ssl verification is off).
When testing the webhook in gitlab, I consistently receive HTTP error 500.
In jenkins pipeline job, I have selected "build when change is pushed to gitlab. gitlab webhook..." - this is the URL I used when defining the webhook in gitlab, under "integrations" section.
When pushing to gitlab, I see no event listed under "integrations -> recent deliveries",
I see no log under jenkins logs "com.dabsquared.gitlabjenkins" logger (set to log level "FINEST".
And lastly, the pipeline job is not triggered as I expected.
Any leads will be very helpful.
Adding printscreen of the Jenkins configuration of the gitlab for reference to the comment I added on possibility this is issue with the personal access token
Jenkins gitlab server configuration
Go to Settings of Gitlab Project -> Integrations and type in the Jenkins Job project url in 'URL'. URL should take either form:
http://JENKINS_URL/project/PROJECT_NAME
http://JENKINS_URL/project/FOLDER/PROJECT_NAME
Notice that the url does not contain "job" within it and instead uses "project".
Make sure under Triggers, you have "Push Events" checked as well if you want the job to trigger whenever someone pushes a commit.
Finally, run a build against your Jenkinsfile first before testing the webhook so Jenkins will pick-up the trigger settings for Gitlab.
Please refer the link for more details.

Jenkins e-mail notification only for first failing commit

For my Jenkins job I would like to have Jenkins send e-mails under two conditions:
The build was fine before, but now it fails.
The build failed before, but now it is fine.
I do not want it to send e-mails for any additional failing builds between (1) and (2).
I would have expected that having the setting "Send e-mail for every unstable build" unchecked would prevent just that, but I receive e-mail for every single failed build.
How can I achieve my desired behavior? Is this a bug in Jenkins (2.121.2) or the Mailer plugin (1.21)?
There is a better plugin for sending emails on certain conditions on Jenkins plugin site: https://wiki.jenkins.io/display/JENKINS/Email-ext+plugin
Try finding Editable email in post-build actions or install it via Jenkins manage plugins options.
Below is a screenshot which is part of the Editable Email notification post-build task:

retrospectively switch on emails for Jenkins jobs

We have a Jenkins instance with over 250 jobs installed in it. Until recently corporate rules prevented us from configuring Jenkins to send emails for build failures etc.
We have now been given permission to configure Jenkins to connect to the corporate SMTP server and I have configured one job to send emails and all is working fine. Is there an automated way to enable emails for all jobs or do I have to go into the configuration for each job and manually enable it?
If not are there any plugins or shell scripts?
Configuration Slicing plugin (https://wiki.jenkins-ci.org/display/JENKINS/Configuration+Slicing+Plugin) can help in this situation.
Install this plugin, then go to Manage Jenkins -> Configuration Slicing -> E-mail Notification
Put email into the left column, all job names to the right column, then press Save.
Please note that it will change each job configuration and add E-mail publisher to them.

Resources