Hello Guys,
I'm trying to block a Status while it has an linked issue "is blocked by". I already tried out several solutions, but otherwise nothing happens or the status is always blocked even if there aren't any linked issues.
Maybe on top it would be nice if I can even check the linked issue if it's not approved yet.
If you visit the {Jira Base URL}/secure/admin/ViewLinkTypes!default.jspa
And click on the Blocks edit button in the URL will have the ID of the Blocks IssueLink (mine was 10000)
Then in the Scripted Validator add the following code to a Simple scripted validator (in the condition section):
import com.atlassian.jira.component.ComponentAccessor
def BLOCKED_BY_LINKID = 10000
def issueManager = ComponentAccessor.getIssueManager()
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def links = issueLinkManager.getInwardLinks(issue.getId())
def linkedIssue
for(def link : links) {
if(link.getLinkTypeId() == BLOCKED_BY_LINKID){
// Have this section if you want to check the "is blocked by" linked issues status
linkedIssue = link.getSourceObject()
if(!linkedIssue.getStatus().getName().equals("Closed")){
return false
}
// If you dont want that extra check then return false and remove the above if
return false
}
}
return true
Hi!
You mean you are trying to block all transitions from the current issue status to that Status?
Depending if the issue has linked issues?
If that's the case you' should put a script condition in every transtion you want block.
https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/scripted-conditions.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.
Register today!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.