changing the JIRA issue my bitbucket commit is linked to

If I commit a change using the message "EZGC-7 #start this is a test of jira integration", the issue in JIRA named EZGC-7 is linked to that commit. But what if I messed up and meant to type EZGC-3, is there any way to undo the linkage and connect the commit to the correct issue? I can't seem to be able to do anything in JIRa other than view the commit

3 answers

1 accepted

This widget could not be displayed.

I spoke with Atlassian on this, there is no way to do this. They added this as a feature request.

This widget could not be displayed.

if your commit was the most recent commit then you can use:

git commit --amend -m "New commit message"

and put the correct commit message and Sync your BitBucket account with JIRA, and it will point to the correct JIRA issue after that, you can also use:

git rebase --interactive $parent_of_flawed_commit

If you want to fix several flawed commits, pass the parent of the oldest one of them.

Sorry, I don't think I made my original question clear:

1. Make my change to the file

2. git add .

3. git commit -m "EZGC-15 issue is fixed"

4. git push

Now, I realize I should have made it "EZGC-14 issue is fixed", how do i update? The command you mentioned requires a merge and then a 2nd commit. If I'm not mistaken, the only time I will see the linked commit in JIRA is after I've pushed my changes, and thus that is the time I'm most likely to find my mistake. You are right that I can amend my message before pushing, but that doesn't help much.

This widget could not be displayed.

You need to stash your changes and get back to the state when you made the commit. Then you can use the commit amend to update the message.

http://blog.jacius.info/2008/6/22/git-tip-fix-a-mistake-in-a-previous-commit/

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

146 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you