Custom field whose value is based on the difference between two other custom field values

Gavin Minnis July 11, 2018

A business manager has requested an SLA whose start date is prior to the issue create date. JIRA does not support this by default. So I'm trying to find an alternative solution. One idea I have is to create three custom fields--Invoice date, Closed Date, Turnaround Time) and make the value of the third field, Turnaround Time, equal to the difference of the Start Date and End Date field values. That is:

Turnaround Time = Closed Date - Invoice date

We have ScriptRunner, and I'm thinking I can use a scripted field for the calculation of the Turnaround Time value. But I'm having trouble getting it to work. My attempts have all ended in errors. But I'm not sure what I'm doing wrong.

Can someone help walk me through how to setup a scripted field to achieve my objective?

For clarity, the "Invoice date" and "Closed Date" fields are Date Time Picker custom fields.

2 answers

0 votes
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.
July 17, 2018

For your first question, https://community.atlassian.com/t5/Answers-Developer-Questions/Groovy-Scripted-Field-to-compare-dates/qaq-p/540301 is still a good starting point for a script, it should help you get through most of your errors!

The gadget is a little different prospect - scripted fields live on issues, they are not for calculations and gadgets, for which I have no "easy" answer - I usually reach for additional reporting tools like EasyBI

0 votes
Gavin Minnis July 11, 2018

Also, in case my current thinking isn't the best option, I also want to share that ideally I want a solution that allows me to then give the business manager a simple gadget where they can track the average Turnaround Times for his team to complete their tasks. That is, what is the average time it takes a ticket to close when compared to the invoice date.

SLAs in JIRA have lots of nice reports and summarized data points. So I hope to also create something similar for this Turnaround time variable.

Gavin Minnis July 17, 2018

Does anyone have any ideas?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events