Forums

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

Automation for Pull requests isn't quite working

Adam Campbell
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 20, 2024

I have an issue where I'm trying to set up an automation that whenever an Issue is assigned a Version, I go out and update the Pull Requests base branch.  I am able to successfully fetch all of the PR's for the Issue, but when there are multiple PR's, I only want to update the `OPEN` Pull Request.

 

As of right now, my flow is this:
When Fix Version is Changed -> Log Information -> Send Web Request to get Pull Requests [WAIT FOR RESPONSE] -> Create Smart Variables for status -> For Each web response, do stuff.

Here's the `do stuff` part:

Screenshot 2024-12-20 at 10.33.01.pngScreenshot 2024-12-20 at 10.32.49.pngScreenshot 2024-12-20 at 10.32.54.png

 

Here are my log entries:

Screenshot 2024-12-20 at 10.35.07.png

 

Now, maybe I'm missing something with Pull Requests, and there's an easier way to get this done.  I would love to hear any feedback. Thank you so much!

1 answer

1 vote
Adam Campbell
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 20, 2024

I actually figured this out.  Instead of doing the `For Each`, I ended up going through each pull request, checking it's status, and setting my value there.

{{#webResponse.body.detail}}

{{#pullRequests}}

if(equals(status,"OPEN"),id.replaceAll("[#]",""))

{{/}}
{{/}}

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