Variables in rules

Modified on Mon, 22 Jul at 11:59 AM

Available on Asana Starter, Advanced, Enterprise, and Enterprise+ tiers, as well as legacy tiers Premium, Business, and Legacy Enterprise.

What is a variable?

A variable is a way to reference key task data within a rule. Variables allow you to create dynamic, flexible rules to fit your workflow.

Which variables can be used?

When rules run, you can reference variables from the following categories in your tasks: Task, People, Dates, Custom fields

People variables are further refined into Task creator, Assignee, and Rule triggerer

You can specify the exact value that the variable displays when the dynamic value is used.

For example, you may wish to refer to the name of a task in a block of text, without @mentioning it, or there may be cases where referring to the task ID number is preferable.

See all variables and the different ways you can display them below.

Task variables

Task variable
How the dynamic value is displayed
Default
@mention or URL of task which triggered rule
Name
Plain text name of task which triggered rule
Description
Content of description field of task which triggered rule
ID
ID number (e.g. 1205100117625723) of task which triggered rule

People variables

People variables are divided into 3 subcategories:

Task creator
Assignee
Rule triggerer
How the dynamic value is displayed
Default
Default
Default
@mention or URL
Name
Name
Name
Plain text name
Email
Email
Email
Email address
ID
ID
ID
ID number (e.g. 1205100117625723)

Date variables

Date variable
How the dynamic value is displayed
Trigger time
Date and time the rule was triggered
Start date
Start date of task which triggered the rule
Due date
Due date of task which triggered the rule
Creation time
Creation time and date of task which triggered the rule

Custom field variables

Custom field variable
How the dynamic value is displayed
Text custom field
Current value in the text field of the task which triggers the rule
Number custom field
Current value in the number field of the task which triggers the rule
Single-select custom field
Current value in the single-select field of the task which triggers the rule
Multi-select custom field
Current value in the multi-select field of the task which triggers the rule
Formula custom field
Current value in the formula field of the task which triggers the rule
Date custom field
Current value in the date custom field of the task which triggers the rule
People custom field
Current value in the people custom field of the task which triggers the rule

Examples of variables in action

This example shows what variables look like when building a rule.

According to the rule, when a task is moved to the Triage section, the rule is triggered and a subtask is created. The subtask contains many variables, each referring to a piece of data from the task which triggered the rule.

Building a rule with variables

screenshot_title

 

  1. Task variables can be used in task titles when the rule creates a task, subtask, or approval. In this example only the task name and task ID variables are used.

  2. Task variables can also be used within the task description. In this example, all 4 task variables are used in the subtask’s description for illustration purposes.

Output of a rule action using variables

screenshot_title

On the left, see the task which triggers the rule when moved into the Triage section of the project. The variables used in the rule will pull the task’s name, description, and task ID into the subtask which is created.

On the right, see the subtask created when the rule is run. The subtask contains the Task, Task name, Task description, and Task ID information which has been pulled from the task which triggered the rule.

Rule actions which support variables

See the various rule actions which support different variables.

Add comment

The Add comment rule action supports all variables and their values, meaning you can reference any Task, People, Date, or Custom field variable, and choose exactly which value (Default, Name, Email, ID) you wish to display when the rule runs.

Set assignee

The Set assignee rule action supports all People variables, meaning you can select Task creator, Assignee, or Rule triggerer. As the action only related to changing the assignee field, the specific values of the variables (Default, Name, Email, ID) are not relevant or supported with this action.

Create task, Create subtask, Create approval

When using the Create task, Create subtask, and Create approval actions, there are four areas within these tasks where variable can be employed; Task name, Task description, Due date field, and the Assignee field.

The Task name field supports all variables and their values
The Task description supports all variables and their values
The Due date field supports all Date variables
The Assignee field supports all People variables


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article