The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
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 Champion
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.