Jira issue status and Gitlab label

ridas.buzius March 25, 2021

Hello, 

Is there any Gitlab and Jira integration function that syncs Gitlab MR label and Jira issue status?

E.g If I put ToDo label on MR - Jira issue status automatically changes to ToDo.

Thanks.

1 answer

1 accepted

0 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 29, 2021

Hi,

I understand that you have a the Gitlab for Jira Cloud app installed to your Cloud site and are wanting to sync the labels on a Gitlab Merge Request to a corresponding issue status for an issue in Jira.

So far I have not found an exact solution for your ask here.  I did investigate this to see if perhaps we could use Gitlab's webhooks in order to make a call back to Jira Cloud for this change to happen.  I also looked into using Jira Cloud's automation devop triggers here.  Although these can be setup to trigger changes to the Jira issue based on such triggers as a deployment status, this is not always 100% equivalent of the labels used on MR in Gitlab.

The problem I find with either approach is multi-faceted.  These problems include:

  1. Labels in Gitlab and status in Jira need never correspond (you might have to create a label in Gitlab for every possible status that exists in Jira)
  2. Labels in Gitlab do not appear to be mutually exclusive, whereas a single issue in Jira can only have hold a single status at one time.  What is the expected behavior if multiple labels in Gitlab are applied at the same time?  Say if both 'to do' and 'done' are added at the same time, what status does the Jira issue go to?

Instead, I think there is a different way to try manage this, although admittedly this has far less to do with automation and more to do with leveraging the existing capabilities that exists with this integration today.

If you want to transition a Jira issue based on a change such as a commit, pull request, merge, etc, you can already do that if you use the proper Smart Commit message.  For example, when you make a commit in Gitlab, you can create a commit message of:

updating README.md blah blah blah SCRUM-2 #To do

Provided that the Jira issuekey of SCRUM-2 has a transition called 'To do' that the issue can be transitioned to, when Jira sees this it will then automatically execute that transition.  I know this is not exactly what you have asked for, but in my own view I think this is an easier change to make today.  The ask to automatically sync the Gitlab MR label into the Jira issue status is considerably more complex to do for several potential environmental differences mentioned above.

I hope this helps.

Andy

ridas.buzius March 29, 2021

Thank You for answer. We'll implement smart commit messages.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events