カスタム Jira 課題キーの正規表現の設定後に Bitbucket Server でコミットが Jira にリンクされなくなった
症状
Bitbucket Server integration with JIRA does not work because JIRA project key has number for example, TST3
After setting custom JIRA issue key regex in Bitbucket Server ([A-Z][A-Z0-9]+), the following appears in the atlassian-bitbucket.log
:
2012-11-08 23:34:38,037 DEBUG [http-7990-4] kahloun.foong 1414x24x1 o068uh 0:0:0:0:0:0:0:1%0 "GET /projects/TST/repos/bitbucket/commits HTTP/1.1" com.atlassian.bitbucket.scm.BaseCommand Executed /opt/local/bin/git for-each-ref --sort=-objecttype --format=%(objecttype)|%(refname)|%(refname:short)|%(objectname)|%(*objectname) refs/heads/ refs/tags/
2012-11-08 23:34:38,538 DEBUG [http-7990-4] kahloun.foong 1414x24x1 o068uh 0:0:0:0:0:0:0:1%0 "GET /projects/TST/repos/bitbucket/commits HTTP/1.1" com.atlassian.bitbucket.scm.BaseCommand Executed /opt/local/bin/git rev-list --format=%H|%h|%P|%p|%an|%ae|%at%n%B%n@@object_end@@ --stdin --
2012-11-08 23:34:40,373 WARN [http-7990-4] kahloun.foong 1414x24x1 o068uh 0:0:0:0:0:0:0:1%0 "GET /projects/TST/repos/bitbucket/commits HTTP/1.1" c.a.s.i.w.s.f.WebPanelFunction An error occurred rendering com.atlassian.bitbucket.bitbucket-jira-integration:jira-issues-commit-list-panel. Ignoring
java.lang.ArrayIndexOutOfBoundsException: 1
at com.atlassian.bitbucket.integration.jira.web.JiraKeyContextProvider$JiraKey.fromString(JiraKeyContextProvider.java:117) ~[na:na]
at com.atlassian.bitbucket.integration.jira.web.JiraKeyContextProvider$1.apply(JiraKeyContextProvider.java:64) ~[na:na]
at com.atlassian.bitbucket.integration.jira.web.JiraKeyContextProvider$1.apply(JiraKeyContextProvider.java:61) ~[na:na]
at com.google.common.collect.Iterators$8.next(Iterators.java:782) ~[guava-10.0.1.jar:na]
at java.util.AbstractCollection.toArray(AbstractCollection.java:124) ~[na:1.6.0_37]
at java.util.ArrayList.<init>(ArrayList.java:131) ~[na:1.6.0_37]
at com.google.common.collect.Lists.newArrayList(Lists.java:119) ~[guava-10.0.1.jar:na]
診断
Run the following SQL query to search for incorrect issue key:
SELECT * FROM cs_attribute WHERE att_value NOT LIKE '%-%';
The column att_value from the result is not a Issue Key but a Project key
原因
The regex added is incorrect so project key is added into the database instead of issue key.
ソリューション
- Backup Bitbucket Server for rollback purposes
- Stop Bitbucket Server
- Modify the custom JIRA issue key regex in Bitbucket Server to have the correct format: - BSERV-2784Getting issue details... STATUS
Delete the incorrect value in the database:
DELETE FROM cs_attribute WHERE att_value NOT LIKE '%-%';
- Start Bitbucket Server
Perform a new commit into Bitbucket Server (The new commit will have link to JIRA)
Last modified on Mar 30, 2016
Powered by Confluence and Scroll Viewport.