Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Transitioning BitBucket issue with a commit message not working

Jim Richards August 3, 2017

I'm trying to understand how this works

https://confluence.atlassian.com/bitbucket/resolve-issues-automatically-when-users-push-code-221451126.html

For I create an issue in BitBucket Cloud, and it has issue #3 with status of open.

I then create a branch

git checkout -b my-issue-3-branch

make some edits and then I make a commit with

git commit -a

and add the comment at the top with

Updates for fix issue #3

I then push the code to remote with

git push -u origin my-issue-3-branch

I can see the commit for the branch, and I can see #3 is linked to issue #3.

According to the documentation, this should transition the issue to a Resolved state and add a comment that matched the commit.

But it doesn't.

Wat am I missing? (It's possible I've skipped a step, but I've donethis a fwe times with commits, and I can't get issues to transition.

4 answers

2 votes
Jim Richards March 17, 2018

Well, this is still occurring for me. I can see in the commit comment that Bitbucket has linked #11 to the correct issue. But it doesn't transition.

Kinda annoying.

0 votes
Gary Whiteford September 13, 2017

I have the same problem.

Scenario 1:

Bitbucket > Issues tracker (in a repository on which I have Write access)

Push with "close issue #" in commit > Creates commit with linked issue in Bitbucket > Does NOT add comment to the issue > Does NOT close the issue

 

Scenario 2:

Bitbucket > Issues tracker (in a repository on which I am Admin)

Push with "close issue #" in commit > Creates commit with linked issue in Bitbucket > Does add comment to the issue > Does close the issue

 

Anyone? ... Anyone?

Jim Richards September 14, 2017

Hmm, I'm the admin for my repo, so I'm not sure what is different between what we're seeing.

I can't find a project on https://jira.atlassian.com/ to look if this has been reported.

Gary Whiteford September 28, 2017

I just noticed that the difference appears to be more related to whether the repository was forked or not. In my scenario 1, the repository is forked (and commit commands do not work). In my scenario 2, the repository is not forked (and commit commands do work). 

Jim Richards March 17, 2018

Hmmm, my repo isn't forked.

0 votes
alexanderwink August 18, 2017

I too have this problem. The issue is never transitioned to a Resolved state. It works for another account (and repository).

0 votes
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 3, 2017

Hi Jim,

It appears you didn't put the transition in your push.  The format should be as follows according to Using Smart Commits in Bitbucket Server:

<ignored text> ISSUE_KEY <ignored text> #<transition_name> <comment_string>

The example from is as follows:

JRA-090 #close Fixed this today

 Cheers,

Branden

Jim Richards August 4, 2017

Hi Brandon,

Thanks, but the page you linked to is when JIRA is linked to BitBucket Cloud and you're using Smart Commits, which is a different feature.

I don't have JIRA, I only have a BitBucket iIssue I'm trying to transition with a git commit as documented in

https://confluence.atlassian.com/bitbucket/resolve-issues-automatically-when-users-push-code-221451126.html

Jim.

eaigner October 29, 2021

What insane person formats commits like

JRA-090 #close Fixed this today

Well, even if I did, still doesn't work. The issue is linked, but nothing is transitioned to DONE.

 

I'd much rather have this format work:

Fixed this today

Closes JRA-090

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events