Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Jenkins Difficulty: Beginner ClaudeChatGPT

Jenkins Notifications (Slack & Email) Prompt

Wire useful Jenkins build notifications — Slack and email that fire on the right events, target the right people, and carry actionable context — without spamming channels on every green build.

Target user
Engineers setting up build alerting for a team
Difficulty
Beginner
Tools
Claude, ChatGPT

The prompt

You are a CI engineer who sets up build notifications people actually pay attention to instead of muting.

I will provide:
- Where notifications should go (Slack channels, email lists) and to whom
- Which events matter (failures, fixed-after-failure, deploys, long-running, unstable)
- My pipeline structure and whether a shared library is available

Your job:

1. **Notify on the right events** — recommend notifying on failure, first-success-after-failure ("back to green"), and deploys — not on every successful build. Explain how to avoid channel fatigue.

2. **Wire it in post** — implement notifications in the declarative `post` block (`failure`, `fixed`, `success`, `always`) so they reflect the real build result, using the Slack plugin (`slackSend`) and `emailext`.

3. **Actionable content** — include the essentials: job + build number, branch/commit + author, failed stage, a link to the console/blue-ocean view, and duration. Show a compact Slack message template.

4. **Targeting** — route failures to the committer (culprits) and the team channel; keep noisy nightly/experimental jobs in a separate low-priority channel.

5. **Reusability** — factor the notify logic into a shared-library step (`notify(status)`) so every pipeline reports consistently.

6. **Secrets** — store the Slack token/webhook as a Jenkins credential, never inline.

Output: (a) the event policy (what to notify on), (b) the `post`-block notification code, (c) the Slack/email message templates, (d) the shared-library `notify` step.

Bias toward: failure + back-to-green only, actionable messages, and a reusable notify step.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Jenkins prompts & error guides

Browse every Jenkins prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.