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

Smart commit - Transition not working

Kevin May 23, 2020

Hi,

I'm using Bitbucket and Jira to handle my workflow.

When I try to use this command :

git commit -m "TEST-2 #close #comment ici le test"

The column of the ticket doesn't change from "To do" to "Done".
I can see the commit in the ticket details but the transition is not working.

I read this topic:

https://community.atlassian.com/t5/Jira-Core-questions/Smart-commit-not-working/qaq-p/387358

I tried to update my email but the transition are not working. Smart Commit is enabled on DVCS accounts.

 

Can you help me this?

Thank you.

3 answers

1 accepted

0 votes
Answer accepted
Peter-Dave Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2020

Perhaps your jira workflow is stopping that transition or jira is not recognizing "close" as a valid transition.

Can you confirm that you are able to perform the transition manually with the same user as the one in your git config without making any field entry in the transition screen?

Is the jira transition from "to do" to "done" actually called "close"? If your transition label is in French (as I see your comment is), you'll want to use that same label in the git message.

This should not impact it, but the #comment command is not required when using a #transition command.

Kevin May 24, 2020

Thank you Peter for your answer.

"Can you confirm that you are able to perform the transition manually with the same user as the one in your git config without making any field entry in the transition screen?"

I have only one user for now. What do you mean by perform a transition manually? I can change a ticket's column in the Jira Software UI if it's what you mean.

From what I understand the transition are based on commit message, correct?
There's no working transition in my commit tests. Even if the commits are attached to the tickets details.
All my tickets are in the default column "todo" and commits doens't change them from "to do" -> "in progress" like the documentation explain it.

You're right, my column are in french with the defaults names :
à faire / en cours / fini -> todo / in progress / done.

I'm using a next gen project.

I just found that maybe I misunderstood the transition system, I thought smart commit wasn't dependant of the transition system from below:

- https://support.atlassian.com/jira-software-cloud/docs/transition-an-issue/
- https://confluence.atlassian.com/fisheye/transitioning-issues-in-jira-960155432.html#TransitioningissuesinJira-Transitionanissuewithyourcommitmessage

So maybe I need create these kind of diagram to make it work?

Thank you.

Peter-Dave Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2020

Ah... next gen project.

I don't have too much experience with those. They don't have the same concepts as what we have in workflows:

StatusA ===TransiionName===> StatusB

With workflow-based smart commits, the command must be "TransitionName".

With netxtgen project, I think the smart commits command must use the target status/column name. Found this other question

And in this case, the english (default) name might be best.

Try

git commit -m "TEST-2 #done ici le test"
Like Kevin likes this
Kevin May 25, 2020

It works! Thank you very much for your help.

git commit -m "TEST-2 #done your message"
git commit -m "TEST-2 #in-progess place ticket in the in progress column"

 Theses examples are working even if the name of the default column are in french, the tickets move between columns now.

0 votes
Levente Szabo _Midori_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 18, 2022

The 3 Smart Commit commands are great, but Data Center (Server) customers are not getting much more of the DevOps automation goodness that Cloud customers getting through the DevOps-related Automation for Jira triggers.

Better DevOps Automation for Jira wants to bring all that to on-prem customers as well. Here is a guide on how to resolve a Jira issue automatically from a commit, but there are many many more commands and use cases available now!

(Please note that I'm part of the team developing Better DevOps Automation for Jira.)

0 votes
Benjamin Mueller
Contributor
October 12, 2020

Hey together,

I have developed the last weeks a add-on, which will reject wrong/invalid smart commits via pre receive hook. Example: if there are typos in transition requests or if the request is just not possible, the commit and/or push will be rejected. It also gives you the recommendation, about the current possible transitions.

It seems this extension is helpful in this case.

Check it out: Smart Commits Checker for Bitbucket 

Feedback is always welcome.

Cheers

Benjamin

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events