Last Internal comment

Hello guys!

Can anyone tell me if:

Is there any way to create a measure that lists the last Internal type comment?

I need to create a table that lists this information on how to measure.

Hi @Fabio.Santos,

It looks like you already have a JavaScript calculated custom field that looks for the last issue comment. eazyBI does not receive information if a comment is internal or visible to customers as well.
You may enhance the JavaScript code with the function getDocument to retrieve additional attributes for each comment and check if it is internal or external:
The code for JavaScript calculated custom field might look like this:

[jira.customfield_lastintcomment]
name = "Last Internal Comment"
data_type = "text"
javascript_code = '''
var comment_count_i = new Array;
issue.fields.comment.comments.forEach(function(comment_item){
  //for each comment check its atributes
  getDocument("comment/" + comment_item.id + "/properties/sd.public.comment", {ignoreErrors: [404]}, function(result){
    if (result && result.value) {
      if (result.value.internal == true) { 
        var lastcomment = issue.fields.comment.comments[issue.fields.comment.comments.length-1];
        issue.fields.customfield_lastintcomment = lastcomment.body
      }
    }
  });
});

In import options validate the JavaScript code Before applying changes to the Javascript code, double-check the customfield name “customfield_lastintcomment” to match your environment.
When you do the changes in advanced settings, make sure to re-import the custom field “Last Internal Comment”.
More details on how to validate and apply changes are here: JavaScript calculated custom fields.

Related topics on how to import comments:

Best,
Zane / support@eazyBI.com