Request resolved with an article

Hi @Fabio.Santos,
By default, it is not possible to get this report.But based on this answer in Atlassian community about what is behind this measure there is a workaround.

On the ticket, there are the field “Related knowledge base articles” and that’s the place where the agent search for the article and then “Share with customer”. After the ticket is resolved, it will show on the report as “Requests resolved with an article”.

The solution that eazyBI can provide is checking how many issues have comments with knowledge base article links in it.
The code is based on this community post and adjusted for checking only links that are shared as KB articles. See it to learn how to add the JavaScript customfield and how the code works:

This is the adjusted code I am using in my test environment:

#KnowledgeBase comments by user - Assignee
[jira.customfield_resolved_by_kb]
name = "KB Comments by user"
data_type = "integer"
measure = true
multiple_dimensions = ["Time","Assignee"]
javascript_code = '''
var resolvedcommentkb = new Array();
var allcomments = issue.fields.comment;
if (allcomments && allcomments.comments ) {
  var comments = issue.fields.comment.comments;
  for (var i = 0; i < comments.length; i++) {
      var comment = comments[i];
      if (comment.body && comment.body.indexOf('http://jira87.internal:8870/servicedesk/customer/kb/view/')>=0){
        resolvedcommentkb.push(comment.created.toString().substr(0,10) + "," + comment.author.name + ",1");
      }
  }
  issue.fields.customfield_resolved_by_kb = resolvedcommentkb.join("\n");
}
'''

This part (“http://jira87.internal:8870/servicedesk/customer/kb/view/”) needs to be adjusted to the URL you have for KB articles.
To get this link, use the option to test the JavaScript code in import options for one issue that contains comment with KB article: JavaScript calculated custom fields
See the comment body in issue JSON:

Adjust the code so it works with your URL, test it and add it to eazyBI advanced settings then select “KB Comments by user” to be imported as a measure.
After the measure is imported you can get this kind of report, it shows you not only resolved issues but all issues with KB articles in the comment section and you can split it by other dimensions, e.g., status:

best,
Gerda // support@eazyBI.com

1 Like