Hello Adaptavist, Atlassian,
I have setup Script Event Handlers and Script Pre Hooks 'Naming standard enforcement' for bugfix and hotfix as per below in Bamboo Server Scriptrunner add-on
bugfix/[A-Z]{2,9}-\d+.*
hotfix/[A-Z]{2,9}-\d+.*Now what we need next is a condition in Pre Hooks or Event Handlers to compare in between commit message JIRA Issue number with the branch JIRA Issue number when there is commits occur.
The idea is that
- To prevent accidental commit into unwanted branch.
- Each JIRA Issue bugfix or hotfix must have its own branch associated with JIRA Issue number.
- Only the same JIRA Issue number can commit.
Example:-
Branch: " bugfix/DEMO-123 Fixing issue xxxx"
Git commit message: " DEMO-123 New commits"
As such, do I need to use "Pre-receive Hooks -> Require commits to be associated with a JIRA issue" ? If so appreciate if you can provide the condition/script that I need to use to archive this.
Thank you in advance.