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"
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Also adding documentation link : Workflow Automation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.