Skip to main content

Jira Component

Jira is a software development tool used for issue tracking, project management, and agile software development. It allows users to plan, track, and release software projects. Jira's core functionality includes the ability to create and assign tasks, track progress and status, and collaborate with team members.

By adding Appcircle's Jira Component component to your workflow, you can add comments or change their status according to your workflow.

Prerequisites

There is no mandatory sequence for the use of this component. It depends on your business decision which step to use before or after in your workflow.

caution

Please note that once the Jira Component has run successfully, the status of the relevant article in your Jira account will be changed. If the build fails in Appcircle, an incorrect status may appear in your Jira account. Make sure you use it in the correct order in Workflow.

Configuration of Component

To add a comment, the issue ID must be supplied to the component. We need to get this issue ID dynamically so that our workflow can work for multiple branches. Appcircle components use environment variables to pass the state. We can add a step just before the Jira Component to prepare the necessary environment variables.

For example, you're working on a feature branch called feature/jiraissue-1. You may use the below Ruby script to get jiraissue-1 from the branch name and use this information with the Jira component. Please see the Custom Script step documentation for this implementation.

branch = ENV['AC_GIT_BRANCH']
feature_name = branch.split('/')[1].upcase
puts feature_name

# Write Environment Variable
open(ENV['AC_ENV_FILE_PATH'], 'a') { |f|
f.puts "AC_JIRA_ISSUE=#{feature_name}"
}

Input Variables

There are some necessary parameters for this stepper to work properly. These parameters are given in the table below with their explanations.

danger

Do not hard-code sensitive variables, such as tokens and API keys, directly to the parameters in the step.

We recommend using Environment Variables groups for such sensitive variables.

Variable NameDescriptionStatus
$AC_JIRA_HOSTYour Jira subdomain. For example: mysubdomain.atlassian.netRequired
$AC_JIRA_EMAILEmail of Jira user. Please use Environment Variables.Required
$AC_JIRA_TOKENUser's API Token. Please use Environment Variables. You can create your token from hereRequired
$AC_JIRA_ISSUEThe ID or key of the issue.Required
$AC_JIRA_FAIL_TRANSITIONTransition ID or name for the failed step. If the previous state succeeds, you can optionally change the status of your issue.Optional
$AC_JIRA_SUCCESS_TRANSITIONTransition ID or name for the successful step. If the previous state succeeds, you can optionally change the status of your issue.Optional
$AC_JIRA_TEMPLATEThis comment template will be used to post a comment. Variables donated with $ will be replaced during the build.Required

Changing Template

Appcircle provides a default template that adds commit id, branch name, time in UTC, and a couple of environment variables. However, this template can be edited and modified according to the Atlassian Document Format (ADF). You can use ADF Builder to create your custom comments.

To access the source code of this component, please use the following link:

GitHub - appcircleio/appcircle-jira-component
Contribute to appcircleio/appcircle-jira-component development by creating an account on GitHub.
GitHub - appcircleio/appcircle-jira-component favicon https://github.com/appcircleio/appcircle-jira-component
GitHub - appcircleio/appcircle-jira-component