How can I do math operations in JQL filters?

Since JQL does not support mathematical operations, what would be the easiest way (or a practical way) to create a custom filter that does mathematical operations? We are trying to create a filter that reports the percentage difference between the original estimate and the time logged for a task.

It seems that 1) implementing a custom JQL function that computes the calculation or 2) adding a hidden field that does the calculation and then can be referenced using JQL would be two of the more efficient ways to accomplish this task.


3 answers

1 accepted

This widget could not be displayed.

I think it's worth pointing out that JQL is not SQL. JQL doesn't actually return any data at all, it simply defines the list of issues that something else is then going to work through.

JQL functions aren't even for returning data, they are more for defining your search.

So, it's a custom field that does the calculation you want really, as fields are display items, not search! I'd follow up what Jamie says.

This widget could not be displayed.

You could use the expression function in script runner. One of the examples in the docs deals with %ages. However that is just for searching for issues.

For reporting, I would imagine there is a plugin already that displays something like this.

Otherwise a calculated field is a good option.

This widget could not be displayed.

SQL for JIRA does the job. It can transforms any JQL into standard SQL with support to operate with numeric regular and custom fields (+,-, * and / among other mathematical operators and functions).

Then you can show that difference on the Issue Detail View with the SQL for JIRA Custom Fields extension.



Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

181 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you