Commit Acceptance Plugin Reject Commits due to Other String similar to Issue Key
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
Often we might need to refer some string that looks like issue key such as ISO standard or other products key such as Crucible review. For example, ISO-8859 was recognized as issue key although it is a ISO standard that has a string like Issue Key. This caused the string to be recognized and rejected by the plugin due to the non-existence of the project in JIRA.
The following appears when you tried to commit the message with string similar to Issue Key:
1
2
Commit message: "TEST-123 The contents of documents have to convert from ISO-8859-1 to UTF-8 character encoding"
Commit rejected: Issue [ISO-8859] does not exist or you don't have permission to access it.
Cause
Part of the problem seems to rely on the Project Key Pattern in JIRA in recognize the issue key in commit message. There's a bug reported on this behaviour: https://ecosystem.atlassian.net/browse/CMMT-18
Workaround
A different project key pattern such as ([A-Z]{4}+) can be use to avoid string such as ISO-XXX or UTF-8 being recognized as issue key during the commit acceptance process. However, such workaround only applies if you're using at least 4 letters projects and reference of 3 letters string such as ISO-XXX. If you have been using 4 letters project key and often refer to 4 letters strings similar to issue key, the workaround may not applies to you.
Was this helpful?