Affects Version/s: 5.6.15
Fix Version/s: 6.0.0
Sprint:DevTools 74, DevTools 75
- Link Bitbucket to Jira.
- Set up a 'Require valid Jira issues' hook with a regex that matches issue keys even when they have lower-case letters in them.
- Create a commit in your local repo that contains a valid lower-case (or mixed-case) issue key.
- Try to push that commit.
Expected: The hook correctly determines that an issue with that key exists, and allows the push.
Actual: The hook rejects the push.
The problem is most likely that when the hook queries Jira in order to validate the keys it has found with the regex, the issue keys in the result are normalised to upper case. Therefore even if an issue key was found that matches the one found in the commit message, the hook wouldn't recognise them as matching because the casing would be different between them. Thus we should normalise the case before making that comparison. Note that this normalisation would take place after the keys had already been scraped from the commits, so if customers want to impose specific casing via the issue key regex then that will still work: we just have to account for the fact that Jira throws the case information away.