Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Script Behaviour - How to limit issue picker filed on form to show only current issue linked issues?


i wanted to show only the issues which are linked to the current issue form (i use issue picker field on the form).  Can anyone help me on this.


many Thakns

Harish Kumar

1 answer

Hi @Harish Kumar

If you intend to use the Behaviour to filter out your Issue Picker for linked issues, you will first need to create an Issue Picker scripted field as shown in the images below:-



Configure the field and add a basic JQL Query for it.


Next, you will need to add a Behaviour configuration. For this, you will need to use the Behaviour Initialiser.

Below is a print screen of the Behaviour configuration:-



Below is an example working code for your reference.

import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript

@BaseScript FieldBehaviours behaviours

def testPicker = getFieldByName("Test Picker")

def issueLinkManager = ComponentAccessor.issueLinkManager
testPicker.hidden = true

if(underlyingIssue!=null) {

def outwardLinks = issueLinkManager.getOutwardLinks(
def inwardLinks = issueLinkManager.getInwardLinks(

if(outwardLinks && inwardLinks) {

outwardLinks.each {
testPicker.setConfigParam("currentJql", "project = ${issueContext.projectObject.key} and key in (${it.sourceObject.key}, ${it.destinationObject.key}) and issueFunction in hasLinks('is blocked by')" )

} else if(outwardLinks) {
outwardLinks.each {
testPicker.setConfigParam("currentJql", "project = ${issueContext.projectObject.key} and key = ${underlyingIssue.key} and issueFunction in hasLinks('is blocked by')" )

} else if(inwardLinks) {
inwardLinks.each {
testPicker.setConfigParam("currentJql", "project = ${issueContext.projectObject.key} and key = ${it.sourceObject.key} and issueFunction in hasLinks('blocks')" )


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

The behaviour can only work once the Issue has been created, and it cannot work on the Create Screen.

Below is a test example:-


 In this sample, the issue IPL-1 has two blocked issues, i.e. IPL-2 and IPL-3. 

So, when the IPL-1 issue is being edited, only the issue(s) that it blocks, i.e. IPL-2 and IPL-3, are available for selection in the issue picker. Other issues are filtered. Below is a print screen for your reference:-


I hope this helps to solve your question. :)


Thank you and Kind Regards,


Hi Ram @Ram Kumar Aravindakshan _Adaptavist_ ,

My query for issue is picker is bit different.

on the current issue if i edit the issue the issue picker field needs to filter the issues in such a way that. it goes to the current epic link and list out all the issues with a certain issuetype into m current issue.

Many Thanks

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

192 views 6 7
Read article

Community Events

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

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you