Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to assign oncall (grabbing the current oncall from pager duty) and assign to incoming Jira task

Lee Segal August 22, 2023

Hi Community,

 

I am looking to assign an incoming Jira task to the current oncall. That person would be grabbed from the pagerduty API (https://api.pagerduty.com/schedules/{id}/users). 

 

I am currently using Jira Automation but its not working. Steps I am taking:

1. Trigger based on task created

2. Send a web request to pagerduty API

3. create a variable oncall. (Look at screenshot how i do that). I believe this is the step i am doing wrong

Screenshot 2023-08-22 at 1.38.19 PM.pngScreenshot 2023-08-22 at 1.38.06 PM.png

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 22, 2023

Hi @Lee Segal -- Welcome to the Atlassian Community!

Since the changes for GDPR were implemented, scenarios like this are more challenging to implement.  Specifically, you have an email address for your on-call person from PageDuty and it is likely your Jira users have a different user name than their email address.

So a few things to try, in order of difficulty / maintenance:

  • JQL: Let's assume the on-call person has had items assigned to them in the past.  You could find an example issue and then use that to assign the issue.
    • JQL could be something like assignee IN ( "{{oncall}}" )
    • Use that JQL with Lookup Issues
    • And then grab the first issue to assign the user to the new task with {{lookupIssues.first.assignee.accountId}}
  • REST API: Call the REST API to get all possible users, filter by the email address, and use the returned accountId
  • Hard-code: use a Lookup Table action to hard-code the possible on-calls using key/value pairs, where key is email address and value is their accountId.  Then use the get() function on the table to assign the person.  This has a limit of 200 rows for a Lookup Table.

Kind regards,
Bill

Lee Segal August 24, 2023

Thanks for the reply Bill! Appreciate it! 

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events