Forums

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

How can I block an issue from being closed until its linked issue is closed?

Sachin Guttala
Contributor
March 17, 2025

 

 

How can I block an issue from being closed until its linked issue is closed?

when user tries to close the issue, error should be displayed like this issue is blocked by "issue id"

5 answers

4 accepted

5 votes
Answer accepted
Marc - Devoteam
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.
March 17, 2025

Hi @Sachin Guttala 

This will require a 3rd party app, like JMWE.

This offers a link issue blocking condition or validation, ootb there is no option for this.

Sachin Guttala
Contributor
March 17, 2025

Hi @Marc - Devoteam thanks for the information.

5 votes
Answer accepted
Rebekka Heilmann (viadee)
Community Champion
March 17, 2025

Hi @Sachin Guttala 

do you have any Marketplace Apps installed, like Scriptrunner, JSU or similar?

You would need to add a condition (this will "hide" the transition if condition if not met) or a validator (you can show a message to the user if validator fails) to the respective Workflow transition.
However, in vanilla Jira you can only block a transition (Condition) if the Sub-Tasks/Children meet/don't meet specific criteria or validate the parent status. There is no option of checking linked issues.

A workaround would be to write an Automation that triggers on the "Close" transition and transition the issue back, adding a comment stating that all linked issues need to be closed first.

Sachin Guttala
Contributor
March 17, 2025

@Rebekka Heilmann _viadee_ thanks for the information.

4 votes
Answer accepted
Tuncay Senturk
Community Champion
March 17, 2025

Hi @Sachin Guttala 

as far as I know, validation on issue transitions based on linked issue status is not directly supported out-of-the-box. However, if you have Script Runner you can do this using Scripted validator wit a script like the below ( I used resolution field but you can change it with the status.name  != 'Closed' or something like that

def linkedIssues = issue.fields.issuelinks
def blockingIssues = []

linkedIssues?.each { link ->
def linkedIssue = link.inwardIssue ?: link.outwardIssue
if (linkedIssue && linkedIssue.fields.resolution == null) {
blockingIssues.add(linkedIssue.key)
}
}

return blockingIssues.isEmpty()

If you don't have ScriptRunner or you don;t want to use a scripted validator, then you can use Automation as a workaround. You can create a custom checkbox field (e.g. "Can be closed") and use an automation rule to set it to true only when all linked issues are "Closed" or resolved. And add a workflow condition that only allows the transition if this field is checked. This way (condition), the user will not even see the transition, but if you want to see the transition and warn with the message, you may use validator.

I hope I was clear

1 vote
Answer accepted
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.
March 17, 2025

Hi @Sachin Guttala 

I couldn't find an easy way to accomplish this in Jira Cloud using other apps, and it is not possible in Jira out of the box. Therefore, we have created the Linked Issues Validator as part of the Workflow Building Blocks for Jira app. 

With simple UI you can decide which links should be checked and in which status or status categories they should be in.

Full disclosure: I am from Forgappify, the vendor of the app.

I would appreciate it if you could give it a try.

Cheers

1 vote
Anna Hryhoruk _Appfire_
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.
March 17, 2025

Hello @Sachin Guttala ,

You can achieve this by adding a workflow Validator to check the linked issue status before allowing the transition to "Closed."

Power Scripts for Jira provides an effective way to implement this using an inbuilt Template or even by creating a custom SIL script validator. We have a Validator template called 'Linked issues are in certain status'. 


How to apply this validator:

  • Edit your workflow and select the transition leading to the "Closed" status.
  • Click Add Validator and choose Power Scripts Validator.
  • Select the pre-built template and select the necessary Link type and Status 
  • Save validator and publish workflow.

2025-03-17 18 25 20 (3).png2025-03-17 18 25 20 (2).png

 

Also adding documentation link : Workflow Automation 

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