Scrip Runner - how to filter issues based on a value of a custom field issue picker

Giacomo Esposito December 11, 2018

Hi all,
I need to make a search to return a list of issues where a condition is on an issue picker custom field value.

The data model is simple, I have two issueType, "Car" and "Official Model":

  1. Car is an issueType with two fields:
    1. Summary (system value)
    2. Model (issue picker custom field) linked to Official Model
  2. OfficialModel is an issueType with two fields:
    1. Summary (system value)
    2. PriceLevel (Select List - single choice) with two options: cheap and luxury

This query works: 
   issuetype = "Car" and Model in ("OM-250")
and return all cars that has the Model-250 as value of Model field


What i need is a query to return all cars that has as model any OfficalModel that has a PriceLevel equal to "cheap",
something like:
  issuetype = "Car" and Model in execute(issueType = "OfficalModel" AND PriceLevel = "cheap")

 

Any idea? Thanks in advance

2 answers

0 votes
Giacomo Esposito December 12, 2018

I'm trying to solve using a different addon that seems for now what I need.
This addon create both a link (so the previous suggested solution is ok) and a copy of a value inside the issueType. The addon is Issue Picker for Jira: https://marketplace.atlassian.com/apps/1218048/issue-picker-for-jira?hosting=server&tab=overview

Payne
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 12, 2018

We use a similar add-on, which led me to offer the guidance that I did, thinking you were using one as well. It works well for us. https://marketplace.atlassian.com/apps/1216498/easy-links-for-jira?hosting=server&tab=overview 

0 votes
Payne
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 11, 2018

I think something like this should work for you:

issuetype = Car and issueFunction in linkedIssuesOf("PriceLevel ~ cheap","LINK_NAME")

where LINK_NAME is the type of link used to link these issue types (e.g "Is Model")

Giacomo Esposito December 11, 2018

Hi, thanks or answer but it doesn’t work, Model is not a link but a  custom field created using ScriptRunner addon 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events