Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create Custom Field Showing the Difference in TIme

michelle.purcell
Contributor
March 3, 2022

I am creating a new project board in a company managed version.  I am looking to track resolution time for incidents.  

I need to create 2 fields: 

  1. Time Identified (Date Picker with time) 
  2.  Resolution Time (Date Picker with time) 

I would like to then add a new field that would show the calculated difference in time between the two.  Can anyone help with suggestions.  

Note:  I have become more experienced with Jira but still consider myself somewhat a beginner when it comes to more complex items. 

2 answers

1 accepted

2 votes
Answer accepted
John Funk
Community Champion
March 3, 2022

Hi Michelle - Welcome to the Atlassian Community!

Create a custom field of type Number that will hold the difference. 

Then create an Automation Rule based on a Field value changed trigger. 

Then add a new action for Edit issue.

Select your new number field. 

Put this is the text box: {{issue.customfield_17363.diff(issue.customfield_17350).hours}}

Where the custom field values represent your two fields you note above. 

michelle.purcell
Contributor
March 3, 2022

Thank you so much John!  This was my first time using the automation. Thank you for making the instructions clear and for your assistance. 

Like # people like this
John Funk
Contributor
March 3, 2022

You are very welcome. You can change hours to minutes or days depending on the level of detail you need. 

Urszula Krupińska
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 5, 2023

Can i achieve this value expressed in hours and minutes? 

1 vote
Trudy Claspill
Community Champion
March 3, 2022

Hello @michelle.purcell 

Welcome to the community.

Are you working with a Software project (vs. a Service Management or Business project)?

Can you not use the Created Date for the "Time Identified" value?

And can you not use the Resolution Date for the "Resolved" value?

Unless you have some third party apps that extend the types of custom fields you can create, you won't be able to create a field that will inherently calculate the value. You will have to use the Automation feature to create a rule to calculate the value and put the value into your custom field. You could trigger the rule based on the changing of the status of the issue to a "done" status. You might also create a rule to clear the field, if the issue is changed from a "done" status to a "not-done" status.

You might alternately be able to do that calculation as a Post Function in your workflow transitions, if you have a third party app that extends the functionality of Post Functions. That would not be something available in Jira natively.

michelle.purcell
Contributor
March 3, 2022

Thanks Trudy.  I cannot use the time difference between the time created and time resolved because after resolution there are some follow-on tasks/fields that need to be populated.  

Suggest an answer

Log in or Sign up to answer