Assign Jira Tickets to the Current Oncall
Fill the Jira assignee field with whoever is on call — via Jira Automation, the Jira REST API, or Pagerly's Slack integration.
Three ways to do this, in increasing order of control.
Jira Automation — no code, runs inside Jira, covers every issue created in a project.
Jira REST API — for tickets created by your own services.
Pagerly's Slack integration — for tickets raised from a Slack thread or emoji reaction.
Prerequisites
A Pagerly team with a schedule. See Create Round Robin Rotations.
A Pagerly API key for options 1 and 2.
Your Jira account connected to Pagerly for option 3.
Your on-call users' Pagerly emails must match their Atlassian account emails.
Option 1 — Jira Automation (recommended)
The rule is two components: fetch the on-call accountId from Pagerly, then assign the issue to it.
Build the rule
Create a new automation rule with the trigger you want — Work item created is the usual one. Narrow it with a condition if you only want it on bugs (
Work item type equals Bug).Click Add component → Action → Send web request.
Set Web request URL to:
https://api.pagerly.io/pagerly/o/currentusersforjira?teamname=<teamname>Replace
<teamname>with your Pagerly team's name.Set HTTP method to
GET. Leave the body empty.Add a header:
HeaderValueX-APIKEYYour Pagerly API key
Tick "Delay execution of subsequent rule actions until we've received a response for this web request".
Step 6 is the one people miss. Without it the rule races ahead to the assign action before the response arrives, the smart value is empty, and the issue is left unassigned with no error in the audit log.
Click Add component → Action → Assign work item.
Choose Smart value as the assignment method.
Under User, enter:
Save and enable the rule.
What the endpoint returns
Pagerly resolves the current on-call user for the team, looks their email up in your connected Jira instance, and returns the Atlassian accountId — so the automation never has to do its own user search.
Handling nobody-on-call
If the schedule has a gap, there is no on-call user to resolve. Add a Condition between the two components:
and, on the else branch, assign to a fallback lead or add a comment tagging the team so the ticket does not disappear.
Reassigning at shift handover
The rule above assigns at creation. If you also want open tickets to follow the rota, add a second Scheduled rule that runs at your handover time with a JQL filter such as:
and the same two components. Label the tickets you want to travel; leave the rest with their owner.
Option 2 — Jira REST API
For tickets your own code creates. Two calls: ask Pagerly who is on call, then PUT the assignee.
A successful assignment returns 204 No Content.
If you would rather resolve the account yourself — for example because you want the on-call user's name and Slack ID for a comment too — use the generic endpoint and Jira's user search:
Jira only returns an email in user search if the user's profile visibility allows it. On many Atlassian instances email is withheld, and query= matching falls back to display name. If you hit this, use /o/currentusersforjira — Pagerly does the resolution on its side.
Option 3 — from Slack, via Pagerly
If the ticket is being raised out of a Slack conversation, Pagerly creates it already assigned.
Create a ticket via emoji — react to a message, Pagerly opens the Jira issue and assigns the team's current on-call.
Create a Jira ticket using a form — the assignee defaults to the on-call for the team the form is bound to.
Round Robin Assignment of Jira Issues/Tickets — distribute across the rota per ticket instead of per shift.
The Slack thread and the Jira issue stay linked, so comments and status transitions flow both ways without anyone opening Jira.
Troubleshooting
Issue created, assignee empty, no error
"Delay execution…" not ticked on the web request
Tick it and re-run
400 from the assign action
accountId was empty — nobody on call
Add the not-empty condition and a fallback
Rule assigns the wrong person
teamname points at a different Pagerly team
Check the name with GET /o/zapier/allteams
accountId returned but assign fails
User has no Jira licence, or no browse permission on the project
Grant access, or exclude them from the rota
Worked yesterday, fails today
Pagerly team was renamed
Update the URL; alert on non-200 responses
Related
Last updated