# Conditions

Conditions decide whether a rule fires. Add multiple conditions and choose whether **all** must match or **at least one**.

Conditions can be nested into groups for complex logic. See [Complex rules](https://missiveapp.com/docs/advanced-features/rules/examples/complex-rules) for examples.

## Message conditions

Check properties of the triggering message.

### Address fields

| Condition     | Checks                         |
| ------------- | ------------------------------ |
| From          | Sender's email address or name |
| To            | Recipients in the To field     |
| Cc            | Recipients in the Cc field     |
| Bcc           | Recipients in the Bcc field    |
| Reply-To      | The Reply-To address           |
| To / Cc / Bcc | Any recipient field            |

### Phone fields (SMS/WhatsApp only)

| Condition | Checks                   |
| --------- | ------------------------ |
| From      | Sender's phone number    |
| To        | Recipient's phone number |

### Content fields

| Condition                    | Checks                                               |
| ---------------------------- | ---------------------------------------------------- |
| Subject                      | Email subject line                                   |
| Message body                 | Full message text                                    |
| Message body (without quote) | Body text excluding quoted replies                   |
| Message content              | Searches across from, to, cc, bcc, subject, and body |
| Attachment name              | Filenames of attachments                             |
| Headers                      | Raw email headers                                    |

### Message properties

| Condition      | Checks                                                                |
| -------------- | --------------------------------------------------------------------- |
| Automated?     | Whether the message is a newsletter, autoresponder, or auto-generated |
| Read trackers? | Whether the message contains tracking pixels                          |
| Spam?          | Whether the message landed in the spam folder                         |
| Sender         | Who sent the message (outgoing rules only)                            |

## Conversation conditions

Check the state of the conversation.

| Condition          | Checks                                            |
| ------------------ | ------------------------------------------------- |
| Email account      | Which email account received the message          |
| Account            | For SMS/WhatsApp/etc: which account received it   |
| Assignee           | Who the conversation is assigned to               |
| Team               | Which team owns the conversation                  |
| Label              | Whether a specific label is applied               |
| Number of messages | How many messages are in the thread               |
| Watching user      | Who is watching the conversation                  |
| Out of office user | Whether any participant is marked away            |
| Conversation state | Whether it's assigned, closed, or in a team inbox |

{% hint style="info" %}
**Email account condition for single-trigger rules**

When multiple email accounts receive the same message (via CC, BCC, or forwarding), incoming email rules trigger once per account. Use the **Email account** condition to run a rule on only one specific account.

This is important for actions like Forward that produce different results each time they run.
{% endhint %}

## Time-based conditions

| Condition                 | Use for                                                               | Available for               |
| ------------------------- | --------------------------------------------------------------------- | --------------------------- |
| Reception time            | Filter by when the message arrived (e.g., "outside business hours")   | Incoming message rules only |
| Rule trigger time         | Filter by when the rule runs                                          | User action rules only      |
| Delay                     | Wait before running actions (e.g., "5 minutes after message arrives") | All rule types              |
| Unreplied and open after  | SLA tracking - fires if no reply within X time                        | Incoming message rules only |
| Unassigned and open after | SLA tracking - fires if not assigned within X time                    | Incoming message rules only |

{% hint style="info" %}
Time-based conditions are key for SLA rules. Combine "Unreplied and open after 30 minutes" with a "Notify" action to alert your team about aging conversations.
{% endhint %}

### How Delay differs from Unreplied/Unassigned and open after

These two approaches work differently and cannot be combined in the same rule.

**Delay** acts as a sequential checkpoint. Missive checks all conditions listed before the Delay first. Once those pass, it waits for the specified duration, then checks any conditions listed after the Delay. Use Delay when you want to pause before performing actions (e.g., send a follow-up 5 minutes after a message arrives).

**Unreplied and open after** and **Unassigned and open after** evaluate all other conditions in the rule immediately when the rule triggers. Only these conditions themselves wait - they fire once X time has passed without a reply or without an assignment. Use these for SLA tracking, where you want to know if a conversation was left unattended.

Because these approaches are mutually exclusive, adding one type of time-based condition will grey out the other types.

### Business hours measurement

For **Unreplied and open after** and **Unassigned and open after** conditions, you can measure time using business hours instead of calendar hours. When enabled, the timer only counts during your organization or team's configured business hours.

This is useful for SLA tracking that excludes nights, weekends, and holidays.

To use business hours:

1. Configure business hours in your organization or team settings
2. Add a time-based condition (Unreplied or Unassigned)
3. Check **Measure in business hours**
4. Select which business hours to use (organization or team)

{% hint style="info" %}
If you use multiple time-based conditions in the same rule, they must all use the same business hours setting.
{% endhint %}

## AI condition

| Condition | Use for                                           |
| --------- | ------------------------------------------------- |
| Prompt    | Ask AI to analyze the message and return a result |

The AI reads the message and responds to your prompt. Match the response using operators like "is" or "contains".

Example prompt: `Is this customer upset? Respond with only YES or NO.`

Then set the condition to fire when the result **is** `YES`.

## User action conditions

These only appear for user action rule types.

| Condition                           | Checks                                                       |
| ----------------------------------- | ------------------------------------------------------------ |
| Action initiator                    | Who performed the action                                     |
| Added label name                    | Name of the label that was added                             |
| Removed label name                  | Name of the label that was removed                           |
| Added label name (or parent name)   | Matches if a child of the specified parent label was added   |
| Removed label name (or parent name) | Matches if a child of the specified parent label was removed |
| Added assignee                      | Who was assigned                                             |
| Removed assignee                    | Who was unassigned                                           |
| New team                            | Team the conversation moved to                               |
| Previous team                       | Team the conversation moved from                             |
| Is a task                           | Whether the comment is a task                                |
| Mention                             | Who was mentioned in the comment                             |

## Operators

Different conditions support different operators:

### Text operators

| Operator            | Matches when                  |
| ------------------- | ----------------------------- |
| is                  | Exact match                   |
| is not              | Not an exact match            |
| contains            | Text appears anywhere         |
| does not contain    | Text doesn't appear           |
| starts with         | Text begins with value        |
| does not start with | Text doesn't begin with value |
| ends with           | Text ends with value          |
| does not end with   | Text doesn't end with value   |

### Contact operators

| Operator                | Matches when                                            |
| ----------------------- | ------------------------------------------------------- |
| in contact group        | Sender/recipient is in a specific contact group         |
| not in contact group    | Sender/recipient is not in a specific contact group     |
| in contact company      | Sender/recipient belongs to a company                   |
| not in contact company  | Sender/recipient doesn't belong to a company            |
| in contact book         | Sender/recipient is in a specific contact book          |
| not in contact book     | Sender/recipient is not in a specific contact book      |
| in contacts             | Sender/recipient exists in organization contacts        |
| not in contacts         | Sender/recipient doesn't exist in organization contacts |
| is a past recipient     | You've emailed this address before                      |
| is not a past recipient | You haven't emailed this address before                 |

### Value operators

| Operator        | Matches when                     |
| --------------- | -------------------------------- |
| is              | Equals the selected value        |
| is not          | Doesn't equal the selected value |
| is present      | Field has any value              |
| is blank        | Field is empty                   |
| is lower than   | Number is less than value        |
| is greater than | Number is more than value        |

### Time operators

| Operator      | Matches when                            |
| ------------- | --------------------------------------- |
| is within     | Time falls within specified hours/days  |
| is not within | Time falls outside specified hours/days |
| is before     | Time is before a specific date          |
| is after      | Time is after a specific date           |

#### Time zone behavior

**is within / is not within** - include a time zone selector directly in the condition. Set it to whichever time zone is relevant (e.g., your office location).

**is before / is after** - display the date and time based on your current device's time zone when you configure the rule. The exact point in time is then saved on the rule. If a teammate in a different time zone views the same rule, the date and time inputs will show the equivalent time in their time zone - but the rule fires at the same absolute moment.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://missiveapp.com/docs/advanced-features/rules/conditions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
