---
title: Issue Team Ownership
description: >-
  Automatically assign issues to teams based on service owners, Git CODEOWNERS
  files, or the team attribute.
breadcrumbs: Docs > Error Tracking > Issue Team Ownership
---

# Issue Team Ownership

## Overview{% #overview %}

Issue Team Ownership automates your triaging work by assigning issues to the right teams. There are three independent ways to infer team ownership, in order of priority:

1. Team attribute: based on the `team` attribute set on the error event at runtime.
1. CODEOWNERS: based on the top-level stack frame of the issue according to GitHub `CODEOWNERS`.
1. Service ownership: based on the owner of the service where the issue happens.

## Team attribute{% #team-attribute %}

You can programmatically assign team ownership at the time an error is raised by setting the `team` attribute to a Datadog team handle.

**Note**: After a team is assigned to an issue through the `team` attribute, the assignment is immutable.

### APM{% #apm %}

Set the `team` attribute on the span, for example:

```python
span.set_tag("team", "payments-backend")
```

### Logs{% #logs %}

Set the `team` attribute on the log. See the [Log Collection documentation](https://docs.datadoghq.com/logs/log_collection/) for details on adding attributes to your logs.

### RUM{% #rum %}

Set the `team` attribute on the RUM event:

```javascript
datadogRum.addError(error, { team: 'payments-frontend' });
```

## CODEOWNERS file{% #codeowners-file %}

Your team owns an issue if it is the code owner of the top-level stack frame of the issue according to your GitHub `CODEOWNERS` file.

**Notes**:

- Stack frames of third-party files are not taken into account. Only the top-most stack frame related to a file present in your repository is considered.
- After a team is assigned to an issue through CODEOWNERS, the assignment is immutable.
- Issue Team Ownership only supports GitHub.

### Setup{% #setup %}

1. Ensure [Source Code Integration](https://docs.datadoghq.com/integrations/guide/source-code-integration) is set up.
1. Install [the GitHub integration](https://docs.datadoghq.com/integrations/github/).
1. Make sure the GitHub integration has all requested permissions (Contents and Members).
1. Create a valid `CODEOWNERS` file in your repository following [GitHub's CODEOWNERS standards](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners).
1. In Datadog, go to [**Teams**](https://app.datadoghq.com/teams) > Select your team > **Settings** > **GitHub Connection** to map your Datadog teams to the corresponding GitHub teams defined in your `CODEOWNERS` file.

{% image
   source="https://datadog-docs.imgix.net/images/error_tracking/team-github-connection.d8c5563ad175b7f8980e51a1649af8dc.jpg?auto=format"
   alt="Linking GitHub teams to Datadog teams" /%}

## Service ownership{% #service-ownership %}

Your team owns an issue if it owns the service where the issue happens. Service ownership is inferred from your existing service ownership configuration in Datadog. No additional setup is required.

**Note**: Teams assigned through service ownership cannot be removed from an issue and are dynamically updated based on the current service ownership.

## Use team ownership{% #use-team-ownership %}

Team ownership information appears on the issue details panel when available:

{% image
   source="https://datadog-docs.imgix.net/images/error_tracking/ownership-details-2.f794c6e4502eac96224b5cec5c569c50.png?auto=format"
   alt="Team ownership information on issue details" /%}

You can also use issue team ownership to filter issues by teams in the Error Tracking Explorer.

{% image
   source="https://datadog-docs.imgix.net/images/error_tracking/ownership-search-bar.6a2dd60f602b40f2e65a3b4e7e2cac2d.png?auto=format"
   alt="Team owner filtering in the search bar" /%}

### Manage team ownership for issues{% #manage-team-ownership-for-issues %}

In addition to automatic team ownership, you can manually add or remove teams from issues.

#### Add a team{% #add-a-team %}

To add a team to an issue:

1. Open the issue details panel.
1. Click **Add team**.
1. Select the team to add.

#### Remove a team{% #remove-a-team %}

To remove a team from an issue:

1. Open the issue details panel.
1. Click the team to remove.
1. Click **Unlink team from issue**.

## Configuration{% #configuration %}

Issue Team Ownership is enabled by default for all services once the setup requirements are met. You can control this feature at both global and service levels through the [Error Tracking settings page](https://app.datadoghq.com/error-tracking/settings/issues/ownership).

{% image
   source="https://datadog-docs.imgix.net/images/error_tracking/ownership-config.b97af0e33fab662e98c1a3464ab9a58c.png?auto=format"
   alt="Issue Team Ownership configuration settings" /%}

## Further Reading{% #further-reading %}

- [Auto Assign](https://docs.datadoghq.com/error_tracking/auto_assign/)
- [Suspected Causes](https://docs.datadoghq.com/error_tracking/suspected_causes/)
