> For the complete documentation index, see [llms.txt](https://docs.pharos.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pharos.ai/configuration-guide/ticketing/rules.md).

# Rules

Configure ticketing rules that determine when Pharos creates tickets in Jira or Azure DevOps.

Ticketing rules automate when Pharos creates tickets in Jira or Azure DevOps. The rule system is similar to [notification rules](https://docs.pharos.ai/configuration-guide/notifications.md): you define filter criteria and actions. When an issue or log matches the criteria, the ticketing action runs (create ticket or add comment).

{% hint style="info" %}
For ticketing concepts and workflows, see [Ticketing and Bugtracking](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/ticketing-and-bugtracking.md).
{% endhint %}

***

## Accessing Ticketing Rules

1. Open the **Pharos** app
2. Navigate to **Pharos Admin**
3. Select **Ticketing** from the left-hand menu
4. Click **Rules**
5. Choose **Issues** or **Logs** (rules exist at both levels; issue-level is recommended)
6. Click **Add New Rule** to create a rule

![Pharos Admin — Ticketing Rules page with sidebar showing Rules and Actions navigation](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-b0da5b2fcdcff9b7b90dddfc7b3a336b005e1f72%2Fticketing-rules-nav.png?alt=media)

***

## Prerequisites

| Requirement                        | Details                                                                                        |
| ---------------------------------- | ---------------------------------------------------------------------------------------------- |
| **Jira or Azure DevOps connected** | Configure in [Integrations](https://docs.pharos.ai/configuration-guide/integrations.md)        |
| **Ticketing action(s) created**    | Define templates in [Actions](https://docs.pharos.ai/configuration-guide/ticketing/actions.md) |
| **Admin access**                   | System Administrator or equivalent                                                             |

***

## Rule Types: Create vs. Update

Use the **Rule Type** dropdown to switch between Create and Update rules:

![Ticketing Rules — Issues tab with Rule Type dropdown showing Create and Update options](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-ef9eec10b7bc10144927d9513b8cd83655cc9acc%2Fticketing-rules-create-dropdown.png?alt=media)

| Rule Type  | When It Fires                              | Typical Use                                                          |
| ---------- | ------------------------------------------ | -------------------------------------------------------------------- |
| **Create** | When a new issue (or log) is created       | Immediate ticket for every new issue                                 |
| **Update** | When an existing issue (or log) is updated | Ticket when issue becomes "hot" (e.g., crosses occurrence threshold) |

**Create rules** fire on first occurrence. **Update rules** fire when an issue evolves — e.g., Log Count > 50, Status changes to "Actioned," or Impacted Users Count > 10.

Update rules are listed with arrow controls for reordering. Rules are evaluated top to bottom, first match wins:

![Ticketing Rules — Update rules list showing three active rules with arrow controls for reordering](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-b9508c3c7dbed490c14836cb18885587b2148b37%2Fticketing-rules-update-list.png?alt=media)

***

## Actions: Create Ticket vs. Add Comment

When adding a ticketing action to a rule, the **Send action to** dropdown shows the available action types:

![Action dropdown showing Jira Ticket and Azure Dev Ops Work Item options](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-e735cef8ba479a5342784f719c77b2ecae285ffc%2Fticketing-rule-action-dropdown.png?alt=media)

| Action Type                                        | Description                         | Rule Types        |
| -------------------------------------------------- | ----------------------------------- | ----------------- |
| **Jira Ticket** / **Azure Dev Ops Work Item**      | Create a new ticket                 | Create and Update |
| **JIRA Ticket Comment** / **Azure DevOps Comment** | Add a comment to an existing ticket | Update only       |

**Comment actions** only work if the issue already has a linked ticket. If the issue has no ticket, the comment action does nothing. Typical sequence: create a ticket for new issues; when the issue becomes hot, add a comment to that ticket.

***

## Creating a Ticketing Rule

### Step 1: Name and Description

1. Click **Add new rule**
2. Enter a **Name** (e.g., "Hot issue → Jira ticket")
3. Enter an optional **Description**

### Step 2: Rule Type

Select **Create** or **Update** from the header to determine when the rule fires.

### Step 3: Filter Criteria

Filter Criteria narrow which issues trigger the rule. Filters can be based on any field on the issue record. By default, all specified criteria must be satisfied (AND logic). Use the **Filter logic** option to override with custom boolean expressions.

**Create rule example** — Only create tickets for Flow issues:

![Create rule form — "All Issues" with a Category = Flow filter](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-713bbe22564a806054981a5b921b66d95275d02e%2Fticketing-rule-create-form.png?alt=media)

**Update rule example** — Create a ticket when an issue crosses 50 occurrences:

![Update rule form — "Over 50" with a Log Count greater-than 50 filter](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-4f4f0eab7c384fbec1a553519babf3ace8f21829%2Fticketing-rule-update-form.png?alt=media)

{% hint style="info" %}
**Create rules** without filters match every new issue — high risk of ticket spam. Always add filter criteria.

**Update rules** without filters fire on every update to every issue. Common update-rule filters include Log Count thresholds, Status changes, and Impacted Users counts.
{% endhint %}

### Step 4: Add Ticketing Action

Once a rule is triggered, it sends one or more actions. You can choose between **Jira** and **Azure DevOps**. Only a single action per rule is supported.

1. Under the **Actions** section, click **Add New** or **Add Existing**
2. Select **Jira Ticket** or **Azure Dev Ops Work Item** (or the comment variant for update rules)
3. The action uses a ticketing action template defined in [Actions](https://docs.pharos.ai/configuration-guide/ticketing/actions.md)

***

## Recommended Approach: Start Manual, Then Automate

Start by creating tickets by hand, then encode the patterns you observe as rules. Two to four weeks of manual triage usually makes the criteria obvious — see [Manual Ticket Creation](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/ticketing-and-bugtracking/issue-level-ticketing/manual-ticket-creation.md) for why this sequencing matters and when to make the transition.

**Phase 1: Manual only**

* Use the **Create Ticket** button on the issue detail page
* Select the ticketing action from the dropdown
* Triage issues, then create tickets for those that warrant action
* Run for 1–2 weeks to learn patterns

**Phase 2: Status-based automation**

* Create an **update rule**: Status changes to "Actioned" → Create Jira ticket
* You still triage manually; the rule creates the ticket when you set status to Actioned
* Saves a few clicks while keeping human triage in the loop

**Phase 3: Threshold-based automation**

* Add **update rules** for issues that become hot (e.g., Log Count > 50 → Create ticket)
* Layer **comment rules** on top (e.g., "Jira Comment on High Occurrence" — if Log Count > 2, add comment)
* Or add **create rules** with strict filters for critical scenarios only

{% hint style="warning" %}
**Avoid Ticket Spam**

A rule with no filter criteria can create many tickets at once if many issues match. Add filter criteria to narrow when tickets are created.
{% endhint %}

***

## Order of Execution: One Ticket Per Issue

Once an issue has a linked ticket, **ticketing automation will not create additional tickets** for that issue. This prevents duplicate tickets even if multiple rules match.

* Manual creation and automated creation are treated the same
* Comment actions can still run (they add to the existing ticket)
* If a completed issue reoccurs, it returns to New and receives a **new** ticket linked to the previous one — the original ticket is never reopened

→ [Learn more: Order of Execution](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/ticketing-and-bugtracking/order-of-execution.md)

***

## Issues vs. Logs

Ticketing rules can be configured for **Issues** or **Logs**:

* **Issues (recommended):** One ticket per unique problem; aligns with how development teams work
* **Logs:** One ticket per log record; rarely needed and can create high volume

→ [Log-level Ticketing](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/ticketing-and-bugtracking/log-level-ticketing.md) covers the narrow cases where log-level tickets make sense, and why issue-level is otherwise better.

***

## Troubleshooting

| Issue                           | Cause                                     | Resolution                                                                    |
| ------------------------------- | ----------------------------------------- | ----------------------------------------------------------------------------- |
| Too many tickets created        | Rule has no filters or criteria too broad | Add filter criteria; start with manual or status-based                        |
| Comment action does nothing     | Issue has no linked ticket                | Comment actions require an existing ticket; ensure a create action runs first |
| Jira comment not in create rule | Comment only available for update rules   | Use comment actions only in update-based rules                                |
| Duplicate tickets               | Should not occur                          | Pharos prevents duplicate automated tickets per issue; verify rule logic      |

***

## Related

* [Actions](https://docs.pharos.ai/configuration-guide/ticketing/actions.md) — Configure ticketing action templates
* [Jira Authentication](https://docs.pharos.ai/configuration-guide/integrations/jira/authentication.md) — Connect Jira
* [Azure Authentication](https://docs.pharos.ai/configuration-guide/integrations/azure/authentication.md) — Connect Azure DevOps
* [Notifications](https://docs.pharos.ai/configuration-guide/notifications.md) — Same rule-based system for alerts
