Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I write a JQL clause to detect my JIRA issue ID

Ashwin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 20, 2018

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.

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events