I want to check my backlog through the scripted field looks like default field on scrum board "Linked issues". But I need to enumerate only those ones that are linked to current by "is blocked by" link and ranked higher in backlog and not in statuses Done or Won't fix.
Thanks for help.
//Get necessary managers
def cfm = ComponentAccessor.customFieldManager
def linkManager = ComponentAccessor.issueLinkManager
def rank = cfm.getCustomFieldObjectByName("Rank")
def issueRankValue = (String) issue.getCustomFieldValue(rank)
def issueProject = issue.getProjectId()
def issueKeys = 
//Go through all linked issues and collect their keys
def linkedIssue = it.destinationObject
def linkedIssueProject = linkedIssue.getProjectId()
def linkType = it.getIssueLinkType()
def linkedIssueRankValue = (String) linkedIssue.getCustomFieldValue(rank)
def linkedIssueStatus = linkedIssue.getStatus()
def linkedIssueStatusName = linkedIssueStatus.getName()
if( issueProject == linkedIssueProject &&
linkType.getInward() == "is blocked by" &&
issueRankValue > linkedIssueRankValue &&
!(linkedIssueStatusName in ["Done", "Won't fix", "Not Reproduced"]) )
if(issueKeys.size() > 0)
return issueKeys.join(', ')
We have this issue, where we're using one epic to demarcate between the ones we care about and the stuff that's "below the line" (e.g. still being refined) and all of the epics are ordered by rank.
This answer doesn't give us a dynamic way to achieve this, but if your magic ticket is fixed, then it should do the job. Let's assume this magic epic is "MG-123". If search in Jira, any search, then replace the JQL with "key = MG-123", then you should get a table of results with one result in it. Add a column to display the "rank" field. You'll get the crazy rank text.
Now, in the JQL search you actually wanted in the first place, your JQL needs to include "rank < 'gibberish'" to only show the stuff above the line or > for the stuff below the line. Something like that.
Apologies - I was led here from How-I-can-I-use-JQL-to-show-all-issues-with-a-rank-higher-than-a-particular-issue and didn't spot the question is different, so my answer is for that question (which has been closed without answer after seven years - thanks Atlassian!)
Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...
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