Jira
The Jira channel posts a comment with the environment and login links on the issue named in the branch. It can also move the issue to another status and assign it to someone, so the issue tracks the deployment without anyone updating it by hand.
This page is for the lead or DevOps engineer who connects deployments to a Jira project. It covers the setup steps, every variable the channel reads, and how the channel finds the issue key in a branch name.
Setup
To set up Jira notifications, complete these steps:
- Create a Jira API token.
- Add
VORTEX_NOTIFY_JIRA_TOKENto your hosting provider's environment variables. - Set
VORTEX_NOTIFY_JIRA_USER_EMAILin your.envfile to the email address of the account that owns the token. - Set
VORTEX_NOTIFY_JIRA_ENDPOINTto the URL of your Jira site, for examplehttps://your-org.atlassian.net, since the default ishttps://jira.atlassian.com. - Add
jirato the comma-separatedVORTEX_NOTIFY_CHANNELSlist in your.envfile, for exampleVORTEX_NOTIFY_CHANNELS=email,jira. - Optional: To move the issue after the comment, set
VORTEX_NOTIFY_JIRA_TRANSITIONto the transition name, for exampleIn Review. - Optional: To assign the issue after the comment, set
VORTEX_NOTIFY_JIRA_ASSIGNEE_EMAILto the assignee's email address.
Confirm that the next deployment of a branch with an issue key posted the
comment. The deployment output on your hosting platform shows
Posted comment with ID and the comment's ID, and the comment appears on
the issue.
The comment has a fixed format: the default message from the Notifications overview, with the label as code and the URLs as links.
Environment variables
See the Notifications overview for the router, what a failed
channel stops, the shared VORTEX_NOTIFY_* variables, and the Location
column. The following table lists the variables that the Jira channel
reads:
| Variable | Required | Default | Location | Description |
|---|---|---|---|---|
VORTEX_NOTIFY_JIRA_TOKEN | Yes | None | Hosting | Jira API token |
VORTEX_NOTIFY_JIRA_USER_EMAIL | Yes | None | .env | Jira user email |
VORTEX_NOTIFY_JIRA_PROJECT | No | VORTEX_NOTIFY_PROJECT | .env | Project name |
VORTEX_NOTIFY_JIRA_ASSIGNEE_EMAIL | No | None | .env | Assignee email after deployment |
VORTEX_NOTIFY_JIRA_TRANSITION | No | None | .env | Transition name, matched exactly (for example, "In Review") |
VORTEX_NOTIFY_JIRA_ENDPOINT | No | https://jira.atlassian.com | .env | Jira API endpoint |
VORTEX_NOTIFY_JIRA_BRANCHES | No | None | .env | Exact branch names to post for (comma-separated); empty posts for every branch |
VORTEX_NOTIFY_JIRA_BRANCH | No | VORTEX_NOTIFY_BRANCH | Hosting | Branch the issue key is extracted from |
VORTEX_NOTIFY_JIRA_LABEL | No | VORTEX_NOTIFY_LABEL | Hosting | Deployment label |
VORTEX_NOTIFY_JIRA_ENVIRONMENT_URL | No | VORTEX_NOTIFY_ENVIRONMENT_URL | Hosting | Environment URL |
VORTEX_NOTIFY_JIRA_LOGIN_URL | No | VORTEX_NOTIFY_LOGIN_URL | Hosting | Login URL |
VORTEX_NOTIFY_JIRA_EVENT | No | VORTEX_NOTIFY_EVENT, then post_deployment | Hosting | Deployment event; pre_deployment posts nothing |
VORTEX_NOTIFY_JIRA_LOG | No | VORTEX_NOTIFY_LOG, then 0 | .env | 1 adds the collected deployment log to the comment as a code block; 0 leaves it out |
VORTEX_NOTIFY_JIRA_LOG_FILE | No | VORTEX_NOTIFY_LOG_FILE | Hosting | Log file added to the comment as a code block; the router sets the default |
Issue key extraction
The channel takes the Jira issue key from the branch name. It uses the first
part of the name that matches the pattern [A-Za-z0-9]+-[0-9]+, as in these
examples:
feature/PROJ-123-add-feature→PROJ-123feature/PRJ-456-fix-auth→PRJ-456
Lowercase keys, such as proj-123, match too. When the branch has no key,
the channel posts nothing and passes.
A date in the name produces a value that isn't a valid issue key:
release/2023-04-17 gives 2023-04. Posting the comment then fails with
Unable to create a comment.
VORTEX_NOTIFY_JIRA_BRANCHES takes exact branch names only, so it can't
exclude a pattern such as release/*. To keep the channel off the
environment of a date-named branch, set VORTEX_NOTIFY_CHANNELS without
jira in that environment's hosting variables. A value set there takes
precedence over .env.