Create complex automation rules with smart values and branches
15 min
Intermediate
By the end of this lesson, you'll be able to:
- Use smart values in rules
- Use branch rules to perform multiple actions
Reference a smart value in an automation rule
Smart values are essentially variables, acting as placeholders for dynamic data in conditions and actions. They allow you to access and manipulate data without using hard-coded values.
👉 For example: You’re creating an automation rule to add a comment to a Confluence page whenever it is updated. You want the comment to include the date and time of the update. Since this rule will run frequently and on various days in the future, you can't specify a fixed date. You can use the {{now}} smart value in your comment text to dynamically show the current date and time whenever the comment is added.
There are many smart values available in Atlassian automation. You can use multiple smart values together to create more specific variables.
👉 For example: You create an automation rule that looks for certain text in new comments on work, then acts if it finds that text. In the condition for that rule, you can use the {{triggerIssue.comment.body}} smart value, which is a combination of the {{triggerIssue}} and {{comment.body}} smart values.
When using smart values in actions and conditions, always enclose them in two sets of curly brackets: {{smart.value}}.
👇Click the boxes below to explore several smart values and why you might use them.
You can access a full list of smart values in Atlassian Documentation.
Let's explore an example
Danika is a space admin for a company-managed Jira space and a Confluence space. Her team has had communication problems in the past, and she wants to automate notifying users when someone comments on their content.
In Jira, Danika would like to notify the work item reporter when someone comments on their work.
In Confluence, she would like to notify the page creator when someone comments on their page.
👇Click the boxes below to explore how Danika should build her automation rules.
Create branches within an automation rule
A branch acts as an independent sub-rule within an automation rule. It runs conditions and actions on multiple related work items. Branches are optional. You can use multiple branches in a rule.
👉 For example: In Jira, you want to create an automation rule that identifies when a work item has a new comment, then adds that same comment to their parent epic. You start by configuring the main automation rule with the Work item commented trigger and a JQL condition with this JQL:
"parent" is not EMPTY
Then, you’d configure the branch rule by selecting Add a branch. There are different kinds of branch rules available.
👇Click the boxes below to explore branch options in Jira.
👇Click the boxes below to explore branch options in Confluence.
A branch on multiple work items, like subtasks, will run in parallel, not one at a time. For example, you can’t depend on the first subtask to be changed before the next subtask.
When would you use branch rules?
Branch rules extend the power of automation rules. Let’s explore several use cases for them.
👉 First example: You decide that all stories within your space should have a parent epic. You can create an automation rule that automatically adds comments to all work items in the space that violate this policy. This will notify all watchers of the work items.
👉 Second example: You want to automatically mark epics as Done when all of the stories in them are marked as Done.
👉 Third example: You’re the space admin for the security team. You want all bugs in your Jira space to have the “security-bug” label so that they appear in your company-wide bug reports and dashboards. You also want all bugs for your team to be automatically assigned to your team lead, Alana.
How was this lesson?
next lesson
What is automation?
- Build rules that automate manual tasks
- Who can use automation?