Smart commit - Transition not working
Asked by Kevin:

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.


Answers:
author: Peter-Dave Sheehan
body: 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.

comments: author: Kevin
body: 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.


author: Peter-Dave Sheehan
body: 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](https://community.atlassian.com/t5/Jira-questions/Can-you-make-Smart-Commits-in-Jira-Next-Gen-projects/qaq-p/1032689)

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

Try

```
git commit -m "TEST-2 #done ici le test"
```


author: Kevin
body: 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.


author: Levente Szabo _Midori_
body: 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](https://marketplace.atlassian.com/apps/1224574/better-devops-automation-for-jira-git-subversion-workflows?hosting=datacenter&tab=overview&utm_source=cac&utm_medium=cac-comment-1387210&utm_campaign=gh) 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](https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Resolve-Jira-issues-automatically-from-the-commit-message/ba-p/2165794), but there are many many [more commands and use cases available now!](https://www.midori-global.com/products/better-devops-automation-for-jira/server/documentation/issue-operations/transitions?utm_source=cac&utm_medium=cac-comment-1387210&utm_campaign=gh)

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


author: Benjamin Mueller
body: 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](https://marketplace.atlassian.com/apps/1223391/smart-commits-checker-for-bitbucket)

Feedback is always welcome.

Cheers

Benjamin


Tags: smart-commit

transition