17

Does anyone know if it's possible to change the status of a Jira issue using a Git commit? I am using Jira and Git with the Jira Git plugin and I know I can reference an issue by just adding the name in the commit but I thought a commit message like "ISSUE-1 #close" would set the status to closed. But this doesn't seem to work.

Am I doing something wrong or is it not possible to send commands via the commit message?

Rob Hruska
  • 118,520
  • 32
  • 167
  • 192
Micky
  • 5,578
  • 7
  • 31
  • 55

2 Answers2

13

If you have FishEye installed you can use smart commits to trigger various actions from a single commit.

Rob Hruska
  • 118,520
  • 32
  • 167
  • 192
Francis Martens
  • 3,458
  • 4
  • 24
  • 26
  • But can you use smart commits with Atlassian stash git repos? From what I read you can't – Alexander Bird Jun 05 '14 at 22:24
  • 3
    That's correct. You need fisheye to enable smart commits. Please vote on https://jira.atlassian.com/browse/STASH-2490. It carries already 266 votes, hopefully atlassian will listen. – Francis Martens Jun 07 '14 at 11:01
6

Here is what you need to do to enable 'smart commits':

https://confluence.atlassian.com/display/AOD/Enabling+DVCS+smart+commits

Then, the syntax to use in the commit messages:

<ISSUE_KEY> #<CMD> <optional CMD_PARAMETERS>

Example:

JRA-123 #resolve

More info on the syntax here:

https://confluence.atlassian.com/display/AOD/Processing+JIRA+issues+with+commit+messages

Nicolay77
  • 2,085
  • 25
  • 20