New Report - No comment for x days

How can i create a report that return the result based on JQL below:

issueFunction in lastComment(“before -3d”) AND project in (“XYZ”) AND status not in (“ABC”) AND issuetype not in (“ABC”) ORDER BY key, status

Result view = gauge

Exemple:

Hi @Renato_Gomes,

By default, data on the issue comments are not imported in eazyBI. However, you can retrieve such information with a JavaScript calculated custom field (JavaScript calculated custom fields - eazyBI for Jira).

  1. First, you might want to import the last comment date as property and measure. The code for JavaScript calculated custom field might look like this:

    #comment last date
    [jira.customfield_lastcommentdate]
    name = "Last comment date"
    data_type = "date"
    javascript_code = '''
    if (issue.fields.comment && issue.fields.comment.comments && issue.fields.comment.comments.length > 0)  {
      var lastcomment = issue.fields.comment.comments[issue.fields.comment.comments.length-1];
      issue.fields.customfield_lastcommentdate = lastcomment.created;
    }
    '''
    

    In import options, select to import last comment date as property and as a measure. eazyBI will create a new measure “Issues with last comment date” to show how many issues have the last comment on each date (Custom Fields - eazyBI for Jira).

  2. In the report, define a new calculated measure (in Measures) to get issues that have the last comment more than 3 days ago.

    --all commented issues
    ([Measures].[Issues with last comment date],
    [Time].CurrentHierarchy.DefaultMember) -
    --subtract count of issues that are commented in the last 3 days
    Aggregate(
      [Time].[Day].DateMembersBetween('3 days ago', 'today'),
      [Measures].[Issues with last comment date]
    )
    

    More details on calculated measures and tuples are here: Calculated measures - eazyBI for Jira.

  3. Set “Status” and “Project” dimensions on pages to filter data.

Best,
Zane / support@eazyBI.com

1 Like

Here are few more topics with JavaScript calculated custom field examples on analysing Jira issue comments:

Hi @zane.baranovska ,
In the case of wanting to obtain the first comment (the text, not the date), how should I modify the code?

@Marcelo_Ignacio_Cid1 to check on the first comment value, you might make three changes:

  • The first comment is the item [0] in the comment array. u
  • Look for the comment field “body
  • Set data_type to the text

The advanced settings and JavaScript to get the first comment text might look like this:

[jira.customfield_firstcommenttxt]
name = "First comment text"
data_type = "text"
javascript_code = '''
//check if there are any comments
if (issue.fields.comment && issue.fields.comment.comments 
    && issue.fields.comment.comments.length > 0) {
  //look for the firt item in the array
  var firtcomment = issue.fields.comment.comments[0]
  //get the field body content
  issue.fields.customfield_firstcommenttxt = firtcomment.body;
}
'''
1 Like

Thanks @zane.baranovska,
It´s amazing

1 Like