Send notifications to Notifer topics from Jenkins pipelines and freestyle jobs.
- Pipeline Step: Use
notifer()in declarative and scripted pipelines - Post-Build Action: Add notifications to freestyle jobs
- Environment Variables: Full support for variable expansion
- Conditional Notifications: Send based on build result (success, failure, unstable, aborted)
- Auto Priority: Automatically set priority based on build result
- Credentials Integration: Secure token storage using Jenkins Credentials
- Go to Manage Jenkins > Plugins > Available plugins
- Search for "Notifer"
- Install and restart Jenkins
- Download the latest
.hpifile from Releases - Go to Manage Jenkins > Plugins > Advanced settings
- Upload the
.hpifile - Restart Jenkins
- Go to your topic in Notifer
- Open Access Tokens
- Create a token with Write or Read/Write access
- Copy the token (starts with
tk_)
- Go to Manage Jenkins > Credentials
- Select appropriate scope (global or folder)
- Click Add Credentials
- Kind: Secret text
- Secret: Paste your Notifer token
- ID: Give it a name like
notifer-my-topic - Click Create
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'make build'
}
}
}
post {
// Use in 'always' block for auto-generated message and priority based on result
always {
notifer(
credentialsId: 'notifer-my-topic',
topic: 'ci-builds'
// message and priority are auto-generated based on build result
)
}
// Or use specific blocks with custom messages (use single quotes for env vars)
success {
notifer(
credentialsId: 'notifer-my-topic',
topic: 'ci-builds',
message: 'Build #${BUILD_NUMBER} succeeded',
priority: 2
)
}
failure {
notifer(
credentialsId: 'notifer-my-topic',
topic: 'ci-builds',
message: 'Build #${BUILD_NUMBER} FAILED!',
priority: 5,
tags: 'failure, urgent'
)
}
}
}
node {
try {
stage('Build') {
sh 'make build'
}
notifer(
credentialsId: 'notifer-my-topic',
topic: 'ci-builds',
message: 'Build successful: ${JOB_NAME} #${BUILD_NUMBER}'
)
} catch (Exception e) {
notifer(
credentialsId: 'notifer-my-topic',
topic: 'ci-builds',
message: 'Build failed: ${JOB_NAME}',
priority: 5
)
throw e
}
}
- Open your job configuration
- Add Post-build Action > Send Notifer Notification
- Select credentials and enter topic name
- Optionally configure message, priority, and when to notify
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
credentialsId |
String | Yes | - | Jenkins credentials ID containing the topic token |
topic |
String | Yes | - | Topic name to send notification to |
message |
String | No | Auto | Notification message (use ${VAR} for env vars). Auto-generated if empty. |
title |
String | No | Auto | Optional message title. Auto-generated if empty. |
priority |
int | No | 0 (auto) | 0=auto (based on result), 1-5=manual |
tags |
String | No | - | Comma-separated tags (max 5) |
failOnError |
boolean | No | false | Fail build if notification fails |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
credentialsId |
String | Yes | - | Jenkins credentials ID |
topic |
String | Yes | - | Topic name |
message |
String | No | Auto | Custom message (auto-generated if empty) |
title |
String | No | Auto | Custom title (auto-generated if empty) |
priority |
int | No | Auto | 0=auto, 1-5=manual |
tags |
String | No | - | Comma-separated tags |
notifySuccess |
boolean | No | true | Notify on success |
notifyFailure |
boolean | No | true | Notify on failure |
notifyUnstable |
boolean | No | true | Notify on unstable |
notifyAborted |
boolean | No | false | Notify on aborted |
The following variables are available in messages:
${BUILD_NUMBER}- Build number${JOB_NAME}- Job name${BUILD_URL}- Full URL to build${GIT_COMMIT}- Git commit hash (if using Git)${GIT_BRANCH}- Git branch name (if using Git)
// Use single quotes for env variable substitution by the plugin
notifer(
credentialsId: 'notifer-ci',
topic: 'builds-${BRANCH_NAME}',
message: 'Deployed to ${BRANCH_NAME}'
)
script {
def testResults = junit 'target/test-results/*.xml'
// Use double quotes here since we need Groovy to evaluate testResults
notifer(
credentialsId: 'notifer-ci',
topic: 'ci-builds',
message: "Build Report:\n- Tests: ${testResults.totalCount}\n- Passed: ${testResults.passCount}\n- Failed: ${testResults.failCount}",
priority: testResults.failCount > 0 ? 4 : 2
)
}
- Verify the credentials ID is correct
- Check the credential is of type "Secret text"
- Ensure the job has access to the credentials scope
- Verify the token has write access
- Check the topic exists and is private
- Test the token with curl:
curl -X POST https://app.notifer.io/YOUR_TOPIC \ -H "X-Topic-Token: tk_your_token" \ -H "Content-Type: application/json" \ -d '{"message": "test"}'
mvn clean package
mvn hpi:run
The .hpi file will be in target/notifer.hpi.
MIT License - see LICENSE