Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation: Send email after two days with Pull Request open

Cláudia Silva
Contributor
May 13, 2025

Hello,

I would like to create an automation that checks pull requests that have been open for more than two days and sends an email to the author to speak to the reviewers.
In the first phase, I set the schedule as a trigger so that the automation runs every day and through a JQL query goes to all the issues of the current sprint and through a smart value compares whether the Pull Request date is greater than 2 days and if so sends an email.
After checking the forum, I realized that the schedule cannot be used as a trigger, but rather something related to the PR.
However, even if I put a For:JQL to collect all the issues that interest me, the smart values ​​will always be related to the PR that I just created (Trigger: Pull Request created).

Is there any idea how I can implement it?

Thanks!

screenshot.png

2 answers

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.
May 13, 2025

Hi @Cláudia Silva 

As the pull request smart values are only available with the PR-related triggers, I believe you will need to do this in three (or more) rules: 

  1. with the Pull Request created trigger, save the created date in a custom field which can later be searched with JQL
  2. with the Scheduled trigger with JQL, find the work items with that custom field matching your criteria to send the notifications
  3. with the Pull Request Merged trigger, clear the custom field so it no longer is found by the JQL in rule #2
  4. add other rules as needed to manage that custom field, such as triggered on Pull Request Declined

 

Kind regards,
Bill

Cláudia Silva
Contributor
May 14, 2025

Hi @Bill Sheboy 

Thank you very much for the alternative, it really could be the solution to be implemented.

 

Kind regards,

Cláudia Silva

Like Bill Sheboy likes this
0 votes
Derek Fields _RightStar_
Community Champion
May 13, 2025

What Git repository are you using (Bitbucket, GitHub, GitLab, etc)? There doesn't seem to be a REST API to get a list of Pull Requests associated with a Jira work item (I looked through the Software REST documentation). My guess is that you need to query the Git front-end to get a list of open pull requests and then use the branch name to identify the issue.

Cláudia Silva
Contributor
May 14, 2025

Hi @Derek Fields _RightStar_ 

The git repository I'm using is Bitbucket. I will try through several automations connected together.
Thank you very much for your reply and help!

Kind regards,

Cláudia Silva

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events