First of all, we need to detect when a new git branch has been created.
Apparently we have 2 ways: push or poll. If we have the admin privilege of git repo, we can define a git hook. The hook subscribes to git branch create event. Or we can define a crontab, which will periodically poll latest branch list, via git ls-remote –heads origin.
Fortunately activesprint usually has a strong naming convention. Say sprint-37/sprint-38 or 1.37/1.38. Once we figure out latest branch list, we can easily detect whether a new activesprint branch has been created.
For a bigger adoption, we use the poll mechanism.

Here comes a Jenkins job, MonitorNewActiveSprint in github. We can also find a live version in our public demo jenkins.
GitHub
Whenver we detect a new activesprint, we fail the job. Then it send out slack notifications.

This is how the Jenkins job looks like.

Once we have it properly configured, we will get the lovely slack notification like below.

Any improvements or suggestions? Share your experience with us!
More Reading:


Blog URL: https://www.dennyzhang.com/slack_activesprint