wrong deployment type derived (from branch name?)

Moritz Deißner
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 18, 2023

We have JIRA connect with gitlab cloud and jira cloud and the deployments are displayed quite nicely in JIRA.
But we have a problem with the environment type. Usually the deployment type in JIRA is the same as in gitlab (= environment type) as defined in `deployment_tier`in .gitlab.ci

But for deployments that have the substring 'product' in their name the JIRA deployment type is always "production". In Gitlab it is correct.

What can we do so JIRA will be in sync on the deployment type with gitlab?

1 answer

0 votes
Ivan Huang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 27, 2024

Hi Mortiz:

We were having JIRA deliver the wrong deployment type as well.

Here's our CI configuration. We also specified our environment with deployment_tier, and JIRA sometimes gets confused.


deploy-staging:
  stage: deploy
  rules:
    - if: $CI_COMMIT_BRANCH == "UAT"
  script:
    - echo "Deploying to staging"
    - exit 0
  environment:
    url: https://$CI_COMMIT_REF_NAME.example.com
    deployment_tier: staging

Our fix was adding the name key under the environment section.

deploy-staging:
  stage: deploy
  rules:
    - if: $CI_COMMIT_BRANCH == "UAT"
  script:
    - echo "Deploying to staging"
    - exit 0
  environment:
    name: staging
    url: https://$CI_COMMIT_REF_NAME.example.com
    deployment_tier: staging

Here's a preview of our environments on GitLab and JIRA.
I hope this will help with your issue.
Screenshot 2024-08-27 at 16.09.35.pngScreenshot 2024-08-27 at 16.12.31.png

Suggest an answer

Log in or Sign up to answer