Reputation: 12295
Jira will automatically scan a git repo and pull in commits that are tagged with a Jira ID (ie QA-244
).
Is there a way to display the links to Jira issues from with SourceTree:
Upvotes: 11
Views: 7285
Reputation: 7641
To make the commit text in SourceTree link to a GitHub Issue or Bitbucket Issue (a simple bug tracker, similar to Jira), where the Issue is in the form "#1234"
, use this approach:
#(\d+)($|[^a-zA-Z0-9-])
(but see the Note below)<a href="https://bitbucket.org/your_username/your_project/issues/$1/">#$1</a>$2
(make sure you include the speech marks)https://bitbucket.org/your_username/your_project/issues/$1
https://github.com/your_username/your_project/issues/$1
#12345
style issue number. It should now show a clickable hyperlink to the issue, which will open your web browser.Note: For step 6, consider using a regex like #(\d{1,4})($|[^a-zA-Z0-9-])
to prevent matching URLs that have "#numbers"
in them, like www.example.com/#123456
- More info here.
Sources:
Apply the same links in JetBrains products
You can also have the same links in IntelliJ IDEA, Android Studio, PyCharm, etc, when viewing the "Version Control" tab for Git history:
IDE ➔ Preferences ➔ Search for "Issue Navigation" ➔ Add ➔ Enter the same regular expression and hyperlink from Step 6 and 7b. More info here.
Upvotes: 13