> For the complete documentation index, see [llms.txt](https://docs.pagerly.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pagerly.io/task-management/assign-tickets-to-current-oncall.md).

# Assign Bugs & Tickets to the Current Oncall

Route bugs, tickets and support conversations to whoever is on call right now — in Jira, Linear and Intercom — instead of leaving them in an unowned queue.

Every ticket queue has the same failure mode: an issue is created, nobody is named on it, and it sits until someone notices. Pagerly already knows who is on call for a team at any instant. This section covers how to feed that answer into your tracker so the assignee field is filled at creation time.

There are two ways to do it, and most teams end up using both:

* **Native integration** — connect the tool to Pagerly and let Pagerly write the assignee. Best for Linear triage and Slack-driven ticket creation.
* **API** — call Pagerly's on-call endpoint from Jira Automation, Zapier, Make, n8n, or your own service, then assign with the tool's own API. Best when the ticket is created somewhere Pagerly does not sit.

{% hint style="info" %}
Both paths resolve the same thing: the **current** on-call user for a named Pagerly team, including overrides and swaps. If someone took an override ten minutes ago, that is who gets the ticket.
{% endhint %}

## Per-tool guides

* [Assign Jira Tickets to the Current Oncall](/task-management/assign-tickets-to-current-oncall/assign-jira-tickets-to-current-oncall.md)
* [Assign Linear Issues to the Current Oncall](/task-management/assign-tickets-to-current-oncall/assign-linear-issues-to-current-oncall.md)
* [Assign Intercom Conversations to the Current Oncall](/task-management/assign-tickets-to-current-oncall/assign-intercom-conversations-to-current-oncall.md)

## The shared building block: who is on call right now

Everything below is built on one endpoint. [Generate an API key](/api-and-developers/generate-api-key.md) first.

**Base URL:** `https://api.pagerly.io/pagerly`

### `GET /o/currentusers`

Returns the users currently on call for a Pagerly team.

| Parameter  | In     | Required | Description                 |
| ---------- | ------ | -------- | --------------------------- |
| `X-APIKEY` | Header | Yes      | Your Pagerly API key.       |
| `teamname` | Query  | Yes      | The team's name in Pagerly. |

```bash
curl --location 'https://api.pagerly.io/pagerly/o/currentusers?teamname=devops' \
  --header 'X-APIKEY: <API-KEY>'
```

```json
[
  {
    "name": "mansi",
    "email": "mansi@pagerly.io",
    "id": "U04CTTV5Z6G",
    "imageurl": null
  }
]
```

`email` is the field you will use almost everywhere — it is the join key between Pagerly and Jira, Linear and Intercom. `id` is the Slack member ID, useful when you also want to `@`-mention the assignee in the ticket comment or in a channel.

{% hint style="warning" %}
**Handle the empty case.** If no one is on call for that team at that moment — a gap in the schedule, a rotation that has not started yet — the endpoint returns `[]`. Your automation must decide what to do: leave the ticket unassigned, fall back to a team lead, or fall back to a Slack usergroup. Do not let it write an empty assignee and fail silently.
{% endhint %}

### `GET /o/currentusersforjira`

A convenience variant that resolves the on-call user's email to a Jira `accountId` for you, so a Jira Automation rule can assign in one step without a second lookup.

```bash
curl --location 'https://api.pagerly.io/pagerly/o/currentusersforjira?teamname=devops' \
  --header 'X-APIKEY: <API-KEY>'
```

```json
{ "accountId": "63c18e6494d18cbf677351fa" }
```

### `GET /o/currentusersformake`

The same payload as `/o/currentusers`, wrapped in an `output` key so Make's iterator can consume it directly.

```json
{
  "output": [
    { "name": "mansi", "email": "mansi@pagerly.io", "id": "U04CTTV5Z6G", "imageurl": null }
  ]
}
```

### `GET /o/zapier/allteams`

Lists the teams in your organisation. Use it to populate a dropdown rather than hard-coding team names in an automation.

```json
[
  { "id": "team-abc123", "name": "Engineering" },
  { "id": "team-def456", "name": "Support" }
]
```

## Choosing a rotation model

The assignment behaviour you get depends on which kind of Pagerly rotation backs the team.

| Rotation type                                                                          | Who gets the ticket                                                                          | Use it when                                                                                        |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| [Time-based schedule](/oncall-and-rotations/create-round-robin-rotations.md)           | Whoever holds the shift at that moment. Two tickets in the same shift go to the same person. | You have a real on-call rota and want the shift holder to own everything that lands in it.         |
| [Task-wise round robin](/task-management/round-robin-rotations-for-tasks-picking-1.md) | The next person in the queue, advancing on every assignment.                                 | You are distributing support load evenly and want ticket count balanced rather than time balanced. |

Both are exposed through the same endpoint, so you can change the model later without touching the automation.

## Common gotchas

* **Email mismatch.** Pagerly resolves users by email. If someone's Slack email is `alice@corp.com` but their Jira or Linear account is `alice.smith@corp.com`, the lookup returns nothing. Keep the primary email consistent, or map it explicitly in the tool.
* **The assignee must exist in the target tool.** Being on call in Pagerly does not create a Jira licence or a Linear seat. A contractor who is on the rota but not in Linear cannot be assigned a Linear issue.
* **Rate the call, not the ticket.** If you create tickets in bulk, cache the on-call answer for the duration of the batch rather than calling the endpoint once per ticket.
* **Deleted schedules.** If a team's schedule is deleted or renamed, `teamname` no longer resolves. Automations referencing it by name will start failing quietly — alert on a non-200 from the endpoint.

## Related

* [Rotate & Assign Requests](/task-management/rotate-and-assign-requests.md)
* [Round Robin Assignment of Jira Issues/Tickets](/task-management/round-robin-assignment-of-jira-issues-tickets.md)
* [Round Robin Assignment of Alerts/Incidents (Opsgenie/JSM Ops)](/task-management/round-robin-assignment-of-alerts-incidents-opsgenie-jsm-ops.md)
* [Integrate Pagerly with APIs, Zapier, Make, and n8n](/integrations/integrate-pagerly-with-apis-zapier-make-and-n8n.md)
