You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hi Team,
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.
Solved! :)
import com.atlassian.jira.component.ComponentAccessor
//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
linkManager.getOutwardLinks(issue.id).each{
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"]) )
{
issueKeys.add("${linkedIssue.key}")
}
}
if(issueKeys.size() > 0)
{
return issueKeys.join(', ')
}
else
{
return null
}
It looks like frequently used functionality. But I didn't find answer during several days.
Any other ideas? - add-ons, gadgets?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.