We have created some custom issue type (e.g. High-level Requirements, Business Requirement, Stakeholder Requirements, etc.) in our Jira instance. We need to list all issues that are linked to more than one issue where issue type is "High-level Requirement"). How can we create this?
We have ScriptRunner add-on, but I can't seem to work it out.
Guys do you think there is a way for me to use scriptrunner's "aggregateExpression" function to do this. So the jql is like:
project = <myproject> and issueFunction in linkedIssuesOf("issuetype='High-level Requirement" and aggregateExpression<"">>1")
You can create a scripted field with Script Runner which has the count of linked issues and use this field for jql search.
Regards
Prakhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If only I find some sort of documentation for me to create scripted field with scriptRunner that counts linked issues and use that as condition in my jql.
Would you be able to give me an example?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the documentation for creating scripted field :
https://scriptrunner.adaptavist.com/5.0.4/jira/scripted-fields.html
You can use this line of code to get all the links :
List<IssueLink> allOutIssueLink = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId());
I need to ready my instance before I can give you the complete script, meanwhile you can try for yourself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here you go for the script :
Use inward or outward link as per your need.
import com.atlassian.jira.issue.link.IssueLink;
import com.atlassian.jira.component.ComponentAccessor;
List<IssueLink> allOutIssueLink = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId());
List<IssueLink> allInIssueLink = ComponentAccessor.getIssueLinkManager().getInwardLinks(issue.getId());
return allOutIssueLink.size() as Double
You can use it in jql like this :
linkedIssueCount > 1
Note : Be careful to select number searcher while defining the custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Jonathan Mondejar
Using Script runner it should be pretty straight forward to implement.
From docs -
issueFunction in hasLinkType("Blockers") and resolution is empty
In the above sample, change "blockers" by the type of the link which other issues are connected to the "High-level Requirement" issueType
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.
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.