Create a JQL to find issues in a Issue Picker searcher

Philippe Puy March 21, 2024

Hi,

I have created a custom script field using scriptrunner, type issue picker searcher.
The name of the field is "Initiative link" it is using the following JQL:
project = REAIT AND issuetype = Initiative
Now I need to create a JQL displaying all the issues that have been set in this field.
I tried this:
issuefunction in linkedIssuesOf('project = REAIT', 'Initiative link')
but it is not working, any ideas?

3 answers

2 accepted

0 votes
Answer accepted
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 25, 2024

Hi @Philippe Puy

For your requirement, you should use ScriptRunner's JQL Function, i.e. Portfolio.

You should try something like this:-

def issue = Issues.getByKey('MOCK-1')// Issue that has the Issue Picker

def issuePickerValue = issue.getCustomFieldValue('Initiative Picker').toString().replace('[','').replace(']','').trim()

Issues.search("""issueFunction in portfolioChildrenOf("type = Initiative and issuekey = ${issuePickerValue}")""")

Please note that the sample code above is not 100% exact to your environment. Hence, you will need to make the required modifications.

Below is a screenshot for your reference:-

console.png

In this example, the Issue Picker value is taken from the issue MOCK-1. The value is the Initiative selected from the Issue Picker.

Once the value from the Issue Picker is extracted, it is placed into the JQL Query.

The result return is the child of the Initiative, i.e. the Epic issue type.

As mentioned above, you will need to modify the code to suite your needs.

Thank you and Kind regards,

Ram

0 votes
Answer accepted
Carla Ann Rowland
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2024

try this:

project = REAIT and  issuelinktype ="Initiative link"

Here is a reference link: https://support.atlassian.com/jira-work-management/docs/jql-fields/#Issue-link-type

0 votes
Philippe Puy March 28, 2024

Thanks for the insight.

Suggest an answer

Log in or Sign up to answer