Forums

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

Is it possible to restrict ticket movement based on whether pr has been merged or not ?

Samarth Sharma
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!
April 25, 2025

Is it possible to prevent a group os users from moving the tickets forward if there is no pr associated with the ticket or whether the pr's associated with the tickets haven't been merged ?

First I tried using automation that whenever a ticket moves forward using a smart value check make sure that all pr's are merged and if they aren't move the ticket back but it came with the challenge of that it should be possible according to the workflow...
So next came towards the workflow rules and have been stuff there

2 answers

0 votes
Maciej Dudziak _Forgappify_
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.
April 28, 2025

Hi @Samarth Sharma 

It should be possible with Jira expression-based validators provided by third-party apps; there are a couple of options available on the Atlassian Marketplace.
It comes down to validating the content of the Development field, which might seem tricky at first glance, but it is not that hard. The value of the field is a JSON saved as a string. For example:

"{pullrequest={dataType=pullrequest, state=OPEN, stateCount=1},
json={\"cachedValue\":{\"errors\":[],\"summary\":{\"pullrequest\":{\"overall\":{\"count\":1,\"lastUpdated\":\"2024-05-28T10:24:34.912+0200\",\"stateCount\":1,\"state\":\"OPEN\",\"dataType\":\"pullrequest\",\"open\":true},\"byInstanceType\":{\"bitbucket\":{\"count\":1,\"name\":\"Bitbucket Cloud\"}}}}},\"isStale\":false}}"

You can use Jira expression to test against the state, for example:

issue.customfield_10000.includes('state=OPEN') ? true : false

When the PR is merged, the value should contain: 'state=MERGED'

I am from Forgappify, and we developed Jira Expression Validator, that you can utilize, which is part of the Workflow Building Blocks for Jira app. In our expression editor, after typing 'issue.', start typing 'Development' to receive the correct suggestion for the ID. You can also provide custom validation message.

I hope it will help.

Cheers 

 

 

0 votes
Tomislav Tobijas
Community Champion
April 28, 2025

Hi @Samarth Sharma ,

We're talking about pull requests here, right? I don't think you'll natively manage to get this; but yes - the idea is to use workflow conditions/validators to restrict changing statuses.

People usually use apps such as JWME and/or ScriptRunner to achieve this > see the following thread.

As for automation, there are smart values for development tools but I haven't used these that much so it would probably take some time to see if it's possible to check if pull request exists on an item and then transition the item back to its previous status. But again, the WF validator/condition would be a more suitable solution.

Cheers,
Tobi

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events