Fetch Current Oncall / Rotated User via API
Fetching current user/oncall
curl --location 'https://api.pagerly.io/pagerly/o/currentusers?teamname=<teamname>' \
--header 'X-APIKEY: <API-KEY>'
Header -> X-APIKEY : Generated API Key
Request param -> teamname -> Your Team's name in Pagerly
Example Request : curl --location 'https://api.pagerly.io/pagerly/o/currentusers?teamname=devops' \
--header 'X-APIKEY: bb04cd53-2ef8-42e0-868b-a8de50884418xxx'
Example Response :
[
{
"name": "mansi",
"email": "[email protected]",
"id": "U04CTTV5Z6G",
"imageurl": null
}
]
Fetching current user/oncall for Jira
curl --location 'https://api.pagerly.io/pagerly/o/currentusersforjira?teamname=<teamname>' \
--header 'X-APIKEY: <API-KEY>'
Header -> X-APIKEY : Generated API Key
Request param -> teamname -> Your Team's name in Pagerly
Example Request : curl --location 'https://api.pagerly.io/pagerly/o/currentusersforjira?teamname=devops' \
--header 'X-APIKEY: bb04cd53-2ef8-42e0-868b-a8de50884418xxx'
Example Response :
{
"accountId": "63c18e6494d18cbf677351fa"
}
How to use this in Jira Automation to automatically assign a ticket to oncall / user ??
Automatically Assign Oncall to Jira Tickets using Jira Automation
On any automation or any new automation , use the following steps
1. Click "Add component"

2. Click "Actions will execute when your rule runs successfully."

3. Click "Send web request"

4. Click the "Web request URL* (required)" field.

5. Enter
https://api.pagerly.io/pagerly/o/currentusersforjira?teamname=<teamname>
in web request url .
Replace your <teamname> in the URL. HTTP method would be GET.
Body would be empty

Alert: Alert! Make sure to check Delay Execution of subsequent ..
6. Enter your header "X-APIKEY" and value would be your API-KEY

7. Click "Add component"

8. Click "Actions will execute when your rule runs successfully."

9. Click "Assign work item"

10. Click "Smart value"

11. Under user add "[[webhookResponse.body.accountId]]

Last updated
Was this helpful?