Set up Jira Cloud
Learn how to set up Jira Cloud and integrate it with other products and applications.
This topic details an optional step in the process of connecting a Jenkins server to a Jira Cloud site using Jenkins for Jira. This step is not necessary to complete a connection and get data flowing, and relies on a good working knowledge of how Jenkins pipelines are made. Some teams may find it useful when setting up a connection to a Jenkins server running a large number of pipelines.
When using the Jenkins for Jira app to send build and deployment events from a Jenkins server to Jira, the Atlassian Jira Cloud plugin on your Jenkins server will look for explicit instructions in your server pipelines to send data to Jira. Specifically, it will look for these instructions in the Jenkinsfiles that define those pipelines.
These instructions are detailed in the set up guide generated in Jira when you connect to a Jenkins server.
In addition, when setting up the Atlassian Jira Cloud plugin on your Jenkins server, a Jenkins admin can opt to enable the following advanced options:
Send builds automatically
Send deployments automatically
When these options are selected, the Atlassian Jira Cloud plugin will look for explicit instructions in your pipelines Jenkinsfiles, as well as particular naming conventions for build and deployment stages in those. If it finds either of these, it will send data to connected Jira sites. For more information see How Jenkins for Jira works.
Some teams, which use a consistent naming convention for build and deployment stages when writing their Jenkinsfiles, may find using stage names more convenient that writing specific instructions into each build and deployment stage, especially if their Jira projects utilize a large number of Jenkins pipelines.
To find out if this is an appropriate option for your team, reach out to your developers and ask:
Who maintains the Jenkinsfiles relevant to each Jira project?
Does your team want:
Granular control of each pipeline that sends data to Jira, or
Jenkins to send build and deployment updates to Jira every time it runs a pipeline.
Once you know who maintains the Jenkinsfiles for each Jira project, ask those team members:
When writing Jenkinsfiles, do you have a consistent naming structure for build and deployment stages?
For example:
Are all build stages named stage('build')?
Are all deployment stages named stage('deploy to staging'), stage('deploy to prod'), and so on
If so, what are those naming structures?
Depending on your team’s answers to the questions above, here’s whether enabling these options is appropriate to your team:
This setting covers how Jenkins sends build events to Jira.
Based on how your team uses Jenkins, here’s what to select:
If your team:
Wants Jenkins to send build updates to Jira every time it runs a pipeline.
Has a consistent naming structure for build stages when writing Jenkinsfiles.
For example, if every build stage is called stage('build')
You or your Jenkins admin should:
Enable this option
Enter a regular expression filter matching your team’s build stage name structure
For example:
If every build stage is called stage('build')
Enter the regular expression ^build$
If your team:
Want Jenkins to send build and deployment updates to Jira every time it runs a pipeline.
Do not have a consistent naming structure for build stages when writing Jenkinsfiles.
You or your Jenkins admin should:
Enable this option
Leave the regular expression filter field empty
If your team:
Want granular control of each pipeline that sends data to Jira
You or your Jenkins admin should:
Disable this option
This setting covers how Jenkins sends deployment events to Jira.
Based on how your team uses Jenkins, here’s what to tell your Jenkins admin:
If your team:
Have a consistent naming structure for deployment stages when writing Jenkinsfiles.
For example, if every deployment stage is called stage('deploy to staging'), stage('deploy to prod'), and so on
Want every pipeline to send deployment data to Jira
You or your Jenkins admin should:
Enable this option
Enter a regular expression filter matching the names your teams use for deployment stages
For example:
If every deployment stage is called stage('deploy to staging'), stage('deploy to prod'), and so on
Enter the regular expression ^deploy to (?<envName>.*)$
Use (?<envName>.*) in place of specific stage names like ‘staging' or ‘prod’ to let Jenkins extract environment names and display these in Jira
If your team:
Does not have a consistent naming structure for deployment stages when writing Jenkinsfiles, or
Want granular control of each pipeline that sends data to Jira
You or your Jenkins admin should:
Disable this option
Was this helpful?