I have to ensure that all commit messages have an associated JIRA issue ID in it. I'm trying to edit the "Require commits to be associated with a JIRA issue" Script pre-hook. I am unable to understand what should go in the condition and the JQL clause.
This is the code I have put in the condition box.
import com.atlassian.bitbucket.repository.RefChangeType
refChanges.any {
it.type == RefChangeType.ADD && (it.refId != /C978451-\d+/)
}
And my JQL clause is - status = "In Progress" and assignee = currentUser().
All my commits get pushed to the server, regardless of whether it contains an issue ID. Where am I going wrong. My JIRA issue is of the pattern C978451-*****, all stars corresponding to digits.