Forums

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

Calculated Field - Time between created and first comment

David Loszewski
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.
March 3, 2022

Hello,

Is there any way to created a calculated field that would tell me the time between when an issue was created and when the first comment is made? I've looked for an addon that can do this but haven't found one yet. 

Thanks. 

2 answers

1 accepted

2 votes
Answer accepted
Zoryana Bohutska _SaaSJet_
Atlassian Partner
March 9, 2022

Hi @David Loszewski 

For this case, you can try SLA Time and Report from the marketplace. This tool allows set timer  accourding to your needs: start - issue created, stop - added comment.

2022-03-09_22-17-24.png

Also you can set time goals and track timer data on the issue view tab.

2022-03-09_22-33-42.png

If you have any questions let me know, because this app is created by my team.

David Loszewski
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.
March 9, 2022

Thanks! is there any way to show the elapsed time opposed to the time until SLA? 

Zoryana Bohutska _SaaSJet_
Atlassian Partner
March 10, 2022

You can set SLA Time goal for example 1m or 0m and then you will see time elapsed

2022-03-10_11-19-50.png

David Loszewski
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.
March 10, 2022

Thank you! Is there a way to view that field in a search or in confluence?  The only two custom fields I see are SLA Goal - 1 status and Target date for SLA Goal -1

David Loszewski
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.
March 10, 2022

I'm also wondering if there's a way to change change the colors since red is not considered as "good".  And also get rid of the '-' in the number. 

1 vote
Matthias Gaiser _K15t_
Community Champion
March 4, 2022

Hi @David Loszewski

How about doing it with Jira Automation?

  1. Create a custom field which stores your calculation
  2. Add an automation with these steps
    1. When: Issue Commented
      This rule will be triggered for every comment
    2. If: Your custom field is empty
      That's a workaround to filter for the first comment only.
    3. Then: Edit your custom field with a smart value like:
      {{issue.created.diff(now).hours}}

Would that work for you?

Cheers,
Matthias.

PS: Here's more background info about Jira Automation and about working with dates.

David Loszewski
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.
March 4, 2022

Does the field type matter? I'm using the following: 

 

{{issue.created.diff(issue."[Chart] Date Of First Response").hours}}

 

But the audit log comes back with nothing.  My custom field is just a number field.  

difference.png

David Loszewski
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.
March 7, 2022

bump

Matthias Gaiser _K15t_
Community Champion
March 7, 2022

Hi @David Loszewski

I think the field type does matter. Can you elaborate why you'd like to use the "[Chart] Date of First Response" - and not my suggestion with the "now" keyword?

Btw: What you're trying to achieve is offered with the SLA's in Jira Service Management projects out of the box. Alternatively, you can also get one one of the SLA apps on the marketplace if that's more convenient for you.

Cheers,
Matthias.

David Loszewski
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.
March 8, 2022

doesn't "now" offer the current date and time, not the time of the first response? That is what the Date of First Response field is providing.  Please correct me if I'm incorrect.  Thank you! 

Matthias Gaiser _K15t_
Community Champion
March 9, 2022

That's correct, David.

My thought was: The automation always runs when the first comment is created -then now is correct. :)

Constanze Schmidt
Contributor
August 29, 2024

Hi Matthias,

I just read David´s question and your suggestion about Jira automation and I´m quite thrilled, because this is exactly the problem I had and the solution I was looking for.

I am not into programming and never used automation before, but with your help, it seemed straight forward enough.

Here´s the rule I created:

2024-08-29_Automation_SAQ-PKI_JIRA.png

 

And it worked!  So happy :-):-) ;-)

Then we realized that the custom field we implemented for the rule was also inserted in all issues created before we installed the rule and because of that, the comment created after the installation was considered as first comment, since the custom field was - of course - empty - no matter how many comments the issue already had.  That led to ridiculous  response times - a no go.

So I decided to mark the older issues with a label or another handy field and include this in the rule.

I chose the field 'Component/s', because it is not used in that project, named it 'No ReponseTime logged' and added it via bulk operation to the older issues.

Then I added a second condition to the rule, excluding the component - and that did the trick.image.png

Like Matthias Gaiser _K15t_ likes this
Matthias Gaiser _K15t_
Community Champion
September 8, 2024

Thank you for sharing, @Constanze Schmidt!

It's always great to hear how an answer helped someone else and how you've modified the rule to find a solution for your use case.

Suggest an answer

Log in or Sign up to answer