Stash does not link commit to JIRA after setting custom JIRA issue key regex

Troubleshooting JIRA Integration

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

Stash integration with JIRA does not work because JIRA project key has number for example, TST3

After setting custom JIRA issue key regex in Stash ([A-Z][A-Z0-9]+), the following appears in the atlassian-stash.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/stash/commits HTTP/1.1" com.atlassian.stash.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/stash/commits HTTP/1.1" com.atlassian.stash.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/stash/commits HTTP/1.1" c.a.s.i.w.s.f.WebPanelFunction An error occurred rendering com.atlassian.stash.stash-jira-integration:jira-issues-commit-list-panel. Ignoring
java.lang.ArrayIndexOutOfBoundsException: 1
	at com.atlassian.stash.integration.jira.web.JiraKeyContextProvider$JiraKey.fromString(JiraKeyContextProvider.java:117) ~[na:na]
	at com.atlassian.stash.integration.jira.web.JiraKeyContextProvider$1.apply(JiraKeyContextProvider.java:64) ~[na:na]
	at com.atlassian.stash.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.

ソリューション

  1. Backup Stash for rollback purposes
  2. Stop Stash
  3. Modify the custom JIRA issue key regex in Stash to have the correct format: STASH-2784 - Getting issue details... STATUS
  4. Delete the incorrect value in the database:

     DELETE FROM cs_attribute WHERE att_value NOT LIKE '%-%';
  5. Start Stash
  6. Perform a new commit into Stash (The new commit will have link to JIRA)

    The old commit will not have link to JIRA because of a bug STASH-2818 - Getting issue details... STATUS

Last modified on Mar 30, 2016

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.