Close Jira issue via Git commit
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
![Micky](https://i.stack.imgur.com/OIl0d.jpg?s=256&g=1)
Micky
Updated on June 04, 2022Comments
-
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 about 10 yearsBut can you use smart commits with Atlassian stash git repos? From what I read you can't
-
Francis Martens about 10 yearsThat'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 over 9 yearsBut this only works for cloud versions of Jira, right?
-
Sunny Tambi about 8 yearsWell, Atlassian documents mention 'Jira Software'. So I am sure it should work with both In-premise and cloud versions of Jira.