Close Jira issue via Git commit

14,050

Solution 1

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

Solution 2

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

Share:
14,050
Micky
Author by

Micky

Updated on June 04, 2022

Comments

  • Micky
    Micky about 2 years

    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?

  • Alexander Bird
    Alexander Bird about 10 years
    But can you use smart commits with Atlassian stash git repos? From what I read you can't
  • Francis Martens
    Francis Martens about 10 years
    That's correct. You need fisheye to enable smart commits. Please vote on jira.atlassian.com/browse/STASH-2490. It carries already 266 votes, hopefully atlassian will listen.
  • qqilihq
    qqilihq over 9 years
    But this only works for cloud versions of Jira, right?
  • Sunny Tambi
    Sunny Tambi about 8 years
    Well, Atlassian documents mention 'Jira Software'. So I am sure it should work with both In-premise and cloud versions of Jira.