Not able to get the " =", "<" and ">" operator in JQL

neeta jain September 2, 2020

Hi Team,

 

I have scripted field called "Risk Level(Calculated)

I have written down the script which populates the value of Risk Level(Calculated) depending on the formula.

When I write down the JQL such as:

Please find attached screenshot.

Please let me know the solution for this.

I need =,<,> operator for it.

 

Regards,

Neeta Jain

 

Risk level error.PNG

2 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 2, 2020

Did you create the calculated field with ScriptRunner or JMCF?

njain2@markem-imaje.com September 3, 2020

Hi David,

 

I have created the calculated field with scriptrunner.

 

Regards,

Neeta Jain

Nic Brough -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.
September 3, 2020

Scriptrunner scripted fields have an "output template" which effectively tells Jira what type of field the result should be seen as.

For your field, I suspect, as John does, that you chose "text", and your code is returning something that Java can interpret as a string.

I think you need a numeric output, as you want to use larger than or less than.

To change over, you will need to:

  1. Amend the scripted field definition, changing the output template to "numeric"
  2. You may need to amend the return value in your script.  The numeric template needs a number to come out, and your current code might be returning a string that contains a number  (This is a "maybe" because if your code is already returning a number, the text template can accept that and treat it as text - so if the answer is 42, the text template is converting it to a string with a 4 character and a 2 character in it)
  3. Go to the list of custom fields, find your Risk Level, and use "Edit" on it.  You will find the name of the field, a description and a "searcher" here.  Change the searcher to "number range"
  4. Re-index the system (background will do, or even just re-index the projects that use the field)

You will then be able to use >=< operators (but not ~ any more)

Like Vibin likes this
neeta jain September 4, 2020

Hi Nic,

Thanks for your quick response.

It worked after changing it to Number range.

Thanks so much for your help.

 

Regards,

Neeta Jain

Like John Funk likes this
1 vote
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 2, 2020

Hi Neeta,

Based on the list that you see, I would say that your field (Risk level) is a text field and not a number field. Therefore you will not see the =, <, > operators. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events