Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How can I prevent an issue from transitioning if there are open pull requests?

I'd like to configure either a condition or a validator (or something similar) to prevent an issue from moving to a specific status if there are open pull requests associated with that Jira issue. We're usually pretty good at catching this, but on occasion there are multiple pull requests associated to a single Jira issue and on occasion the issue has been moved before all of the pull requests have been merged.

1 answer

1 vote
Moses Thomas Community Leader May 29, 2018

@Nickolas Schaderit's all about permission,  if you set validation/condition even if the are multiple request  one who you  give permission/what you set can perform this transition, as  for move issue you  can also block who can move issue in a project in the permission schemes



Thanks for the suggestion @Moses Thomas but I don't think it solves my issue. I want to prevent a developer from moving an issue when there is an open pull request. If we use permissions to limit who can perform the transition, they can still move it if there are open pull requests.

Moses Thomas Community Leader May 30, 2018

@Nickolas Schader

We have the View development tools permission 

this should do  the trick  see documentation.


Thanks @Moses Thomas, that allows us to view the Development information, but I don't see how to use that to prevent an issue from transitioning.

@Nickolas SchaderLets do  it this way previous suggestion  is not enough try  this

- You  have integrate your  /Bitbucket/Whatever  properly, 

- Add  a condition in this trasition > script condition >Allows the transition if this query matches a JQL query

-enter this JQL query : 

(status = Done OR resolution = done) AND development[pullrequests].all > 0 

this JQL should return  any issues that have  been resolved with a non-merged pull-request associated with the issue,  so  transition  can only  be performed if all  pull request  associated  with  this issue are done.

Hope this will do.

@Moses Thomas I think that would do it, but I don't see an option for 'script condition'. Is that part of the Script Runner add-on?

Moses Thomas Community Leader Jun 07, 2018

@Nickolas SchaderYes , unfortunately.

@Nickolas Schader Did you find any other way?

@Moses Thomas I have been working for the same Jira problem that is in discussion i.e. preventing an issue from transitioning if there are open pull requests.

I have Script Runner available but unable to find the correct way for doing it, can you assist?

@Anveshan Goel  This solution  Would work flow script runner plugin  for server, but script runner plugin  for  cloud  is limited  as there are differences,  I think  is why  @Nickolas Schader  can't  find  this option which i  have  mentioned. I am  afraid we don't have this  feature in  cloud.

Unfortunately I do not have Script Runner and have not been able to come up with a solution for this.

As always with Jira (atlassian). Valid issue and yet no viable solution. But hey, I'm sure Atlassian team is busy with full jira redesign yet again.

Sorry, could not resist... We have exactly the same problem where we need to prevent issues to be closed if an associated Pull Request is still open, and we are using Jira cloud.

Like aamelkin likes this

FYI -- automation works for this. You can have a rule that automatically reverts the state of the ticket if there are open PRs.

Like Sakthiya Giri likes this

Hi @Tudor Achim , 

Can you share how you achieved this with auto rule?

@Magdalena Zhisheva not the exact same scenario which you're looking for, but I created the following rule which reopens tickets with no associated PRs and resolution done. 
Not sure it's the best way, but it's working.. 

Hi @Gilad Sharaby , 

Thank you!

I were able to build the following rule and seems to working for now for two teams in our instance:

Screenshot 2022-04-03 at 15.23.10.png

Hope it will help someone :) 

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you