ScriptRunner Issue Picker from Issue type and custom field match

Rich Wolverton
Contributor
April 24, 2020

We have a JIRA Custom Issue type called Host that contains the details of Host servers that may participate in data transfer. It has a select list for Owner.

We have a Custom Issue type for Data Transfer Request that contains a custom field select list for Business Partner.

We have a working Scriptrunner Issue Picker for Requested Host on the Data Transfer Request that returns all issues of type Host. We would like to add match to the Owner on the Host issue type with the Business Partner on the Data Transfer Request to limit the list of possible Hosts

I am not seeing how to construct the JQL systax or Adaptavist Behavior to make this happen. Any example of this possibility would be appreciated.

2 answers

2 votes
Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 27, 2020

Hey Rich,

This was a fun little exercise to do and I learned something new about Scriptrunner in the process.

It looks like this is something that you can do using behaviors for Scriptrunner.

After configuring my custom issue picker,  custom fields, and issue types, I build the following behavior:

 

def partner = getFieldByName("Business Partner")
def partnerValue = partner.getValue()
//This is my issue picker field, rename it to what yours is.
def issuePicker = getFieldByName("Issue Picker")

//Update your JQL here.
issuePicker.setConfigParam('currentJql', 'project = ESTD AND issuetype = Host AND Owner = ' + partnerValue )

The  last  line is really what is key here for how the ticket will update the values available as you update the Business Partner Field.

Rich Wolverton
Contributor
April 30, 2020

Thank you Kain.

I am experimenting with this as time permits and will let you know questions and results. The connection is off custom fields for sender and receiver and I need to have one behavior for each but I am getting there.

Like # people like this
Rich Wolverton
Contributor
October 25, 2021

For the record. This worked perfectly on Jira Server but was not transferable to Jira Cloud

We are looking at other Apps to fill the gap. 

Like Deleted user likes this
1 vote
Consulente Atlassian
Contributor
October 25, 2021

@Kian Stack Mumo Systems  but if I want to do the same thing but on the customer portal, not inside the jira issue seen by the Agent, but on the customer portal. Can I do it?

Suggest an answer

Log in or Sign up to answer