Automatic error assignment

Learn how to implement a rules based approach to automatically assign an error to a collaborator or team

Automatic Error Assignment is available for Enterprise plans only.

Triaging errors can be a repetitive process and often follows the same decision-making process, e.g. assigning all errors in the src/components/cart directory to the “Cart Team” or an individual collaborator. BugSnag allows you to create rules to automate this process.

How to create a rule

To get started with automatic error assignment go to Project settings > Automatic error assignment.

There are three ways a rule can target errors:

  • Code location
  • Default metadata
  • Custom metadata

Code location

If you wish to assign an error based on the location of a file or directory you can do so using a glob pattern. You can reference the Linux documentation for more information on glob patterns.

code location using glob pattern

Default metadata

This is a selection of fields that are sent by default with an error, e.g., context, user.id etc. Note that this does not include custom metadata.

default fields

Enter the value you wish to match to the field. The value is exact match but case insensitive.

context value

Custom metadata

To automatically assign errors based on custom metadata you will need to use dot notation prepended with metaData - so if you have a tab in the error details page named owners and that tab had the property owner you would reference this using metaData.owners.owner.

context value

Enter the value you wish to match to the field. The value is exact match but case insensitive.

The automatic assignment rules run for an error on its first instance only; the error will not be reassigned on subsequent instances, even if you change the collaborator or team to which the rule is assigned.

Managing precedence

Order is important. Rules are applied in order until a match is made. Drag and drop rules to change the order.

Drag and drop to change the order of rules

In general, more specific rules should be higher up the list. For example you might have /src/components/cart/cart.tsx towards the top, then **/*.tsx lower down if you wanted a fallback catch-all rule for .tsx files.