Forums

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

How to get the timestamp of the first public comment made?

Marc Jason Mutuc
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.
January 30, 2019

We have ScriptRunner, JMCF and JWT. 

2 answers

0 votes
David Fischer
Community Champion
January 31, 2019

Are you trying to create a calculated field that will display the date of the first comment that was posted on the issue and that is public in the Jira Service Desk sense? If that is the case and you're using JMCF 2.0, I can provide the script, just let me know.

Marc Jason Mutuc
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.
February 12, 2019

Yes. Similar to how the resolution time is being calculated. For resolution time, I use the formula below:

<!-- @@Formula: issue.get("resolutiondate")==null ? null : (issue.get("resolutiondate").getTime() - issue.get("created").getTime()) / 1000 / 60 -->

I've an existing response time that uses the transition field as reference. So step 1 is that I get the transition date/time then use that field to compare with created to get the response time.

However, I think it would be better if the comparison is between created date/time and time of first public comment.

David Fischer
Community Champion
February 12, 2019

The problem is identifying public comments - because there might be internal comments exchanged on the request before the first public comment is published.

In JMCF 2.1, coming out in the next few days, you'll be able to write:

issue.get("comment").find{!it.isInternal()}?.created
Marc Jason Mutuc
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.
February 12, 2019

Thanks David! Will JMCF 2.1 allow us to use the fields on the dashboard moving forward?

David Fischer
Community Champion
February 12, 2019

What do you mean by "on the dashboard"?

0 votes
Nir Haimov
Community Champion
January 31, 2019

Hi,

Use Scriptrunner with this script:

import com.atlassian.jira.component.ComponentAccessor

def commentManager = ComponentAccessor.getCommentManager()
def comments = commentManager.getComments(issue)

comments[0].created

 

Marc Jason Mutuc
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.
February 12, 2019

Thanks! Will test it out! :)

Suggest an answer

Log in or Sign up to answer