How to send deployment info from Jenkins when no changes have been made?

Vanessa Anderson
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!
January 15, 2021

We are using Jenkins (scripted pipelines) and are so excited to be leveraging the new Deployments view in Jira! We ran into one issue when running manual deployments (sans changelog).

Our current workflow is that dev / qa are deployed from the same branch, and dev shows up in the deplyoment view, but QA does not because Jenkins' changlog service does not pull in the changes since its been previously deployed.

  1.  Is there a plan to integrate a parameter into jiraSendDeployment which would allow us to include the issue key there?
  2. We are also looking into manually writing a changelog.xml file for the build, but wanted to ask if that was the right approach? 

 

 

1 answer

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 16, 2021

Hello @Vanessa Anderson ,

I don't have a wide knowledge on this topic so please excuse me if I write anything wrong.

However, I have asked our dev team and I have been told that deployments from the same branch in different environments should pop up in the issue view as long as you configure the jiraSendDeploymentInfo in each stage. Each environment in your pipeline should be a different stage. You can find some examples in the below documentation pages:

pipeline {
     agent any
     stages {
         stage('Deploy - Staging') {
             when {
                 branch 'master'
             }
             steps {
                 echo 'Deploying to Staging from master...'
             }
             post {
                 always {
                     jiraSendDeploymentInfo site: 'example.atlassian.net', environmentId: 'us-stg-1', environmentName: 'us-stg-1', environmentType: 'staging'
                 }
             }
         }
         stage('Deploy - Production') {
            when {
                branch 'master'
            }
            steps {
                echo 'Deploying to Production from master...'
            }
            post {
                always {
                    jiraSendDeploymentInfo site: 'example.atlassian.net', environmentId: 'us-prod-1', environmentName: 'us-prod-1', environmentType: 'production'
                }
            }
         }
     }
 }

 

 

Also, regarding providing the issue keys to the pipeline, I believe that this is documented in: Integrate Jira Cloud with Jenkins

Specify custom logic to get issue keys

By default, the plugin extracts issue keys from all the commit messages in the change log of the build. It is possible to override this behavior to add your own logic and supply the list issue keys as an issueKeys parameter.

jiraSendDeploymentInfo site: '<sitename>.xyz.net', 
environmentId: 'us-prod1', environmentName: 'us-prod2', 
environmentType: 'production', issueKeys: ['DEV-001', 'DEV-002']

 

For more details on this topic, you may want to review below links:

 

 

Cheers,
Dario

Suggest an answer

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

Atlassian Community Events