Jira Deployments for production linking all Jira Issues with Trunk-Based Development
Problem (more detailed below): Jira Deployment Panel for Production is showing all Deployments for past Issues, adding on new ones as they're executed.
Situation:
I'm using Jira Deployments and Gitlab. Projects are using Trunk-Based Development, meaning a main branch and short-lived feature branches.
Branch: Anything is developed on a dedicated feature branch with structure <Jira-Issue-ID>-<short-summary>.
Merge Request: From a Branch, the MR has a Title/Summary in the format: <Jira-Issue-ID> (<action>) <short summary>, for example: KW-19 (Added) Created Converting to Gitlab CI article.
The branch main is automatically deployed to the staging Environment after merging a Merge Request into it, and it generates a Release. These Deployments show up correct in Jira Deployments:
The production Environment has a Pipeline created for it after a Tag is created on a commit following Semantic Versioning. A manual action is required to run the deploy step for this Environment, which also creates a Release. These deployments are not shown correctly in Jira Deployments:
Additionally (examples using KW-12 from images above):
- When checking the "Builds" tab, it shows the correct Pipeline information.
- When checking the "Deployments" tab, we see a lot more associated runs:
I have already been in contact with Atlassian on this topic, and they have said that there is nothing on their side they can do to fix this, as the data is all provided through the Gitlab for Jira Cloud integration.
To rule it out, or to point out the fault is in my configuration instead, I have attached the .gitlab-ci.yml file the project uses.
Extra research & issue assumptions
The documentation on the Jira Development Panel integration from Gitlab says that if the Jira Issue is mentioned in the Commit Message, it should display the following information in the Jira Development Panel:
- Link to the commit
- Link to the deployment from up to 5,000 commits after the last successful deployment to the environment 3 4
3 (1) & 4 (2):
-
Introduced_ in GitLab 16.2 with a flag named
jira_deployment_issue_keys. Enabled by default._ -
Generally available_ in GitLab 16.3. Feature flag
jira_deployment_issue_keysremoved._
I think the problem I am experiencing is here, where it automatically attaches up to 5,000 commits since the last successful Deployment to the Environment. However, I have not been able to figure out how to either configure it properly, use it properly, or determine whether this is actually a bug.
My current thinking is that the plugin is somehow unable to determine the Deployments, and thus cannot determine "[..] commits after the last successful deployment to the environment". It then falls back to "Current deployment and going back 5,000 commits (i.e.. inception of repository in this case)".
This is unwanted behaviour, as the main branch is Tagged using Semantic Versioning, has a Deployment with a Release through a Pipeline on the Tag, and even has the correct Pipelines showing up in the Build section of the Jira Development Panel.
The reason it would grab link the new Deployment to the old Jira Issues is the formatting of the MR titles (shown at the top of the issue). The history of the repository commits basically has all merges start with Jira Issue ID's.
I am quite keen to get this fixed/resolved, so if any additional information is needed, please let me know and I'll get it here as soon as I can.



