• Get started
  • Documentation

When, if, and then statements

Are you looking for Automation?

This article is relevant to Legacy automation in service projects created before August 30, 2021. If you don’t see Legacy automation in your service project, check out these Automation articles.

An automation rule is made up of three parts:

  1. When this happens… statements trigger the rule.

  2. Optional If these match… conditions narrow the trigger to effect only certain issues, users, comments, links, statuses or resolutions.

  3. Then do this… statements perform an automated action.

When this happens

Automation rules require one When this happens… trigger to start an automated acton. Here’s all the available When this happens… triggers:

Comment added

A comment is added to an issue.

Comment edited

A comment on an existing issue is edited.

Issue created

An issue is created in the project.

Issue resolution changed

The issue's resolution field is set or modified.

Status changed

An issue transitions through a stage in its workflow.

A linked issue is transitioned

An issue linked in the same Jira cloud site transitions through a stage in its workflow.

Participant added to issue

A request participant is added to the issue.

Organization added to issue

An organization is added to the issue, or someone shares an issue with an organization.

Approval required

The issue transitions to a workflow stage that requires approval. Learn more about approvals

Approval completed
An approval step on an issue is accepted or declined. Learn more about approvals

SLA time remaining

The issue's SLA cycle reaches a certain time remaining.

If these match

Use optional If these match… conditions to target specific issues or other activity on your service project.

If these match… statements vary depending on the When this happens… trigger.

Here’s all the available If these match… conditions:

Issue matches

An issue matches a certain filter.

Comment visibility

A comment is visible either internally to agents or externally to customers.

User type

The user type is customer or agent.

Comment contains

A comment contains a key phrase.

Comment is primary action

A comment is the primary action and not the consequence of another action.

Resolution change

The issue's resolution status change either sets or clears the resolution field.

Status change visible to customer

The issue's workflow status change is visible to the customer.

Link type matches

A link type matches a certain type of link.

Linked issue matches

A linked issue matches a certain filter.

Then do this

A When this happens… trigger sets the rule in motion. The Then do this… action is the automated action or outcome of the trigger.

Here’s all the available Then do this… actions:

Transition issue

an issue forward or backward through its workflow.

Add comment

Comment internally to agents or externally to customers on an issue.

Alert user

Prompt specific users via an @mention.

Auto-approve/decline 

Approve or decline a request based on your IF field.

Edit request type

Change an issue's request type. Be sure your request types are the same issue type before applying this rule.

Create issue

Create a new linked issue in any project on the same site. 

Edit issue

Change a field in the issue, such as assignee or priority. This affects fields that may not appear in each issue type.

Send email

Send a custom email notification.

Webhook

Send a POST request.

Still need help?

The Atlassian Community is here for you.