# Nesting AND() and OR() conditions

**URL:** <https://forum.asana.com/t/nesting-and-and-or-conditions/1007788>\
**Category:** Product Ideas\
**Created:** [30 December 2024 13:42 UTC](https://forum.asana.com/t/nesting-and-and-or-conditions/1007788 "2024-12-30T13:42:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan-Rienk](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/jan-rienk/32/227709_2.png) [@Jan-Rienk](https://forum.asana.com/u/Jan-Rienk)\
**Post date:** [30 December 2024 13:42 UTC](https://forum.asana.com/t/nesting-and-and-or-conditions/1007788/1 "2024-12-30T13:42:32Z")

</div>

It would be handy if we could combine AND() and OR() functionality in a single branch.

For instance, when a task is overdue in a project, I would like to send a message if it is in one of two sections. The message would change depending on whether the task is assigned or not.

Because I cannot combine AND and OR, I have to set up four branches to achieve this:  
Trigger: Task is overdue

1. Check if: Task is in secion 1 AND task is assigned

2. Check if: Task is in section 2 AND task is assigned  
1 and 2 would use the same messsage, addressing the assignee

3. Check if task is in section 1 AND task is not assigned

4. Check if task is in section 2 AND task is not assigned  
3 and 4 would also use the the same message, addressing someone else

A better way to deal with this would be:

1. Check if `AND( task_has_assignee, OR( task_in_section_1, task_in_seciton_2))` ➡ Add comment `@task.assignee`
2. Check if `task_in_section_1 OR task_in_seciton_2` ➡ add comment @mentioning someone else

(I’m not checking if it is unassigned, as that check would obviously result in TRUE as it is the only alternative when it is in one of those sections and the first branch wasn’t activated.)

Related: [General conditions for rules](https://forum.asana.com/t/general-conditions-for-rules/1007781)

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [31 December 2024 02:31 UTC](https://forum.asana.com/t/nesting-and-and-or-conditions/1007788/2 "2024-12-31T02:31:52Z")

</div>

> [@Jan-Rienk](#):
>
> if we could combine AND() and OR() functionality in a single branch.

Agreed, it’s a good suggestion for Asana to implement.

Just FYI, our Flowsana rules have this capability now. 😉

---

<div class="post-metadata">

**Author:** ![Jan-Rienk](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/jan-rienk/32/227709_2.png) [@Jan-Rienk](https://forum.asana.com/u/Jan-Rienk)\
**Post date:** [31 December 2024 09:23 UTC](https://forum.asana.com/t/nesting-and-and-or-conditions/1007788/3 "2024-12-31T09:23:55Z")

</div>

As it does with half of the improvements I suggest for Asana rules it appears. I’m impressed.
