Request resolved with an article

Hi everyone,

Does anyone know if there is any way to make a report that shows the problems solved with an article similar to the jira report?

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

Hello @gerda.grantina!

Thanks for your return.

I tried to get the link to confluence using the java test as informed by you but I am not able to complete successfully.

I created the custom javascript code below

[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(‘Jira Service Management’)>=0){
resolvedcommentkb.push(comment.created.toString().substr(0,10) + “,” + comment.author.name + “,1”);
}
}
issue.fields.customfield_resolved_by_kb = resolvedcommentkb.join("\n");
}
‘’’
When I’m trying to run the java test, the system returns this message:
image

When I run the custom JavaScript code test with the TICKET-183845 issue and without adding the field suggested by you, I got the result below:
image

========================================================================
{
“expand”: “renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations,customfield_10187.properties,customfield_10188.properties,customfield_10189.properties,customfield_10015.requestTypePractice,customfield_10310.properties,customfield_10093.properties,customfield_10094.properties”,
“id”: “322769”,
“self”: “https://dealernet.atlassian.net/rest/api/2/issue/322769”,
“key”: “TICKET-183845”,
“properties”: {
“request.channel.type”: {}
},
“changelog”: {
“startAt”: 0,
“maxResults”: 11,
“total”: 11,
“histories”: []
},
“fields”: {
“customfield_10190”: null,
“customfield_10070”: {},
“customfield_10191”: null,
“customfield_10192”: null,
“customfield_10193”: null,
“customfield_10194”: null,
“customfield_10195”: null,
“customfield_10196”: null,
“customfield_10197”: null,
“customfield_10198”: null,
“customfield_10199”: null,
“resolution”: {},
“customfield_10079”: null,
“lastViewed”: “2021-11-23T15:04:35.296-0300”,
“customfield_10180”: null,
“customfield_10060”: {},
“customfield_10181”: null,
“customfield_10182”: null,
“customfield_10061”: {},
“customfield_10183”: null,
“customfield_10062”: null,
“customfield_10063”: “,”,
“customfield_10064”: “processo: Jira Service Management”,
“customfield_10065”: “+551732148087”,
“customfield_10187”: null,
“customfield_10066”: null,
“customfield_10067”: null,
“customfield_10188”: null,
“customfield_10189”: null,
“customfield_10068”: null,
“customfield_10069”: null,
“labels”: [],
“aggregatetimeoriginalestimate”: 0,
“issuelinks”: [],
“assignee”: {},
“components”: [],
“customfield_10290”: null,
“customfield_10291”: null,
“customfield_10292”: null,
“customfield_10171”: null,
“customfield_10172”: null,
“customfield_10293”: null,
“customfield_10173”: null,
“customfield_10294”: null,
“customfield_10052”: {},
“customfield_10295”: null,
“customfield_10174”: null,
“customfield_10175”: null,
“customfield_10296”: null,
“customfield_10176”: null,
“customfield_10297”: null,
“customfield_10177”: null,
“customfield_10298”: null,
“customfield_10299”: null,
“customfield_10178”: null,
“customfield_10179”: null,
“customfield_10059”: {},
“customfield_10280”: {},
“subtasks”: [],
“customfield_10281”: {},
“customfield_10160”: null,
“customfield_10040”: null,
“customfield_10161”: null,
“customfield_10282”: null,
“customfield_10041”: null,
“customfield_10283”: null,
“customfield_10162”: null,
“customfield_10284”: 250,
“customfield_10042”: {},
“customfield_10163”: null,
“customfield_10164”: null,
“reporter”: {},
“customfield_10285”: null,
“customfield_10043”: {},
“customfield_10044”: null,
“customfield_10286”: null,
“customfield_10166”: null,
“customfield_10045”: null,
“customfield_10287”: null,
“customfield_10288”: null,
“customfield_10167”: null,
“customfield_10289”: null,
“customfield_10159”: null,
“customfield_10039”: null,
“progress”: {},
“votes”: {},
“worklog”: {},
“issuetype”: {},
“customfield_10270”: {},
“customfield_10271”: {},
“customfield_10150”: 0,
“customfield_10151”: 0,
“customfield_10030”: null,
“project”: {},
“customfield_10152”: null,
“customfield_10031”: null,
“customfield_10153”: null,
“customfield_10032”: null,
“customfield_10274”: {},
“customfield_10033”: null,
“customfield_10154”: null,
“customfield_10275”: {},
“customfield_10034”: null,
“customfield_10276”: {},
“customfield_10155”: null,
“customfield_10156”: null,
“customfield_10277”: {},
“customfield_10035”: null,
“customfield_10278”: {},
“customfield_10157”: null,
“customfield_10036”: null,
“customfield_10158”: null,
“customfield_10279”: {},
“customfield_10037”: null,
“customfield_10148”: null,
“customfield_10027”: null,
“customfield_10269”: null,
“customfield_10028”: null,
“customfield_10149”: 0,
“customfield_10029”: null,
“resolutiondate”: “2021-11-17T11:57:15.721-0300”,
“watches”: {},
“customfield_10261”: null,
“customfield_10140”: null,
“customfield_10262”: null,
“customfield_10020”: null,
“customfield_10141”: null,
“customfield_10021”: null,
“customfield_10263”: null,
“customfield_10142”: null,
“customfield_10022”: {},
“customfield_10264”: null,
“customfield_10265”: null,
“customfield_10266”: null,
“customfield_10145”: null,
“customfield_10267”: null,
“customfield_10146”: null,
“customfield_10147”: {},
“customfield_10268”: null,
“customfield_10026”: null,
“customfield_10137”: “Favor preencher campo.”,
“customfield_10258”: null,
“customfield_10016”: [],
“customfield_10017”: null,
“customfield_10138”: null,
“customfield_10259”: null,
“customfield_10139”: null,
“customfield_10018”: null,
“customfield_10019”: null,
“updated”: “2021-11-17T13:33:49.273-0300”,
“timeoriginalestimate”: 0,
“description”: “Ao processar arquivo faturamento de pecas enviado pela VW, da mensagem que nao encontrou a referencia da peca 1K6955651, e esta referencia esta cadastrada no estoque de produtos.”,
“customfield_10251”: null,
“customfield_10130”: 2,
“customfield_10131”: 2,
“customfield_10010”: null,
“customfield_10132”: 0,
“customfield_10011”: “0|i1i233:”,
“customfield_10133”: 0,
“customfield_10012”: “2021-11-17T11:57:16.126-0300”,
“customfield_10134”: 3,
“customfield_10013”: “10084_:1:6710754|10141:1:20679|10030:1:8602|10079:1:_0”,
“customfield_10014”: null,
“customfield_10135”: “Favor preencher campo.”,
“customfield_10015”: {},
“timetracking”: {},
“customfield_10126”: null,
“customfield_10127”: null,
“customfield_10129”: {},
“customfield_10008”: null,
“customfield_10009”: {},
“summary”: “Erro ao processar arquivo Faturamento Pecas VW”,
“customfield_10240”: {},
“customfield_10120”: {},
“customfield_10121”: “747616273”,
“customfield_10000”: “{}”,
“customfield_10242”: {},
“customfield_10122”: null,
“customfield_10001”: null,
“customfield_10243”: {},
“customfield_10244”: null,
“customfield_10123”: null,
“customfield_10124”: {},
“customfield_10125”: null,
“customfield_10004”: [],
“environment”: null,
“customfield_10117”: null,
“customfield_10118”: null,
“customfield_10119”: null,
“duedate”: null,
“comment”: {},
“statuscategorychangedate”: “2021-11-17T11:57:16.169-0300”,
“customfield_10230”: null,
“customfield_10110”: {},
“customfield_10231”: null,
“fixVersions”: [],
“customfield_10111”: {},
“customfield_10232”: null,
“customfield_10233”: null,
“customfield_10234”: null,
“customfield_10113”: null,
“customfield_10114”: null,
“customfield_10104”: null,
“customfield_10225”: null,
“customfield_10226”: {},
“customfield_10105”: null,
“customfield_10106”: null,
“customfield_10227”: {},
“customfield_10107”: {},
“customfield_10228”: null,
“customfield_10229”: null,
“customfield_10108”: null,
“customfield_10109”: null,
“customfield_10340”: null,
“customfield_10220”: null,
“customfield_10341”: null,
“priority”: {},
“customfield_10342”: null,
“customfield_10222”: null,
“customfield_10343”: [],
“customfield_10223”: null,
“customfield_10345”: null,
“customfield_10103”: null,
“customfield_10335”: null,
“customfield_10214”: null,
“customfield_10215”: null,
“customfield_10216”: null,
“customfield_10217”: null,
“timeestimate”: 0,
“customfield_10218”: null,
“customfield_10219”: null,
“versions”: [],
“status”: {},
“customfield_10330”: null,
“customfield_10210”: null,
“customfield_10331”: null,
“customfield_10211”: 0,
“customfield_10332”: null,
“customfield_10333”: null,
“customfield_10213”: null,
“customfield_10203”: null,
“customfield_10324”: null,
“customfield_10325”: null,
“customfield_10204”: null,
“customfield_10205”: null,
“customfield_10326”: null,
“customfield_10206”: null,
“customfield_10327”: null,
“customfield_10207”: null,
“aggregatetimeestimate”: 0,
“customfield_10328”: null,
“customfield_10329”: null,
“customfield_10209”: null,
“creator”: {},
“aggregateprogress”: {},
“customfield_10320”: {},
“customfield_10321”: {},
“customfield_10200”: null,
“customfield_10322”: {},
“customfield_10323”: null,
“customfield_10314”: null,
“customfield_10315”: null,
“customfield_10318”: {},
“customfield_10319”: {},
“timespent”: 360,
“aggregatetimespent”: 360,
“customfield_10310”: null,
“customfield_10311”: null,
“customfield_10312”: null,
“customfield_10302”: null,
“customfield_10303”: null,
“customfield_10304”: null,
“customfield_10305”: null,
“customfield_10306”: null,
“customfield_10307”: null,
“customfield_10308”: null,
“customfield_10309”: null,
“workratio”: 9223372036854776000,
“issuerestriction”: {},
“created”: “2021-11-17T10:04:01.489-0300”,
“customfield_10300”: null,
“customfield_10301”: null,
“customfield_10090”: {},
“customfield_10091”: null,
“customfield_10092”: “6.4 21.10.3”,
“customfield_10093”: null,
“customfield_10094”: null,
“customfield_10097”: {},
“security”: null,
“attachment”: [],
“customfield_10080”: null,
“customfield_10081”: null,
“customfield_10082”: 0,
“customfield_10083”: 0,
“customfield_10084”: 0,
“customfield_10087”: null,
“customfield_10088”: {},
“customfield_10089”: {},
“customfield_activities”: “Automation for Jira,2021-11-18,1\nCaio Cesar Moreira De Oliveira,2021-11-18,1\nAutomation for Jira,2021-11-18,1\nCaio Cesar Moreira De Oliveira,2021-11-18,1\nCaio Cesar Moreira De Oliveira,2021-11-18,1\nCaio Cesar Moreira De Oliveira,2021-11-18,1\nCaio Cesar Moreira De Oliveira,2021-11-18,1\nCaio Cesar Moreira De Oliveira,2021-11-18,1\nCaio Cesar Moreira De Oliveira,2021-11-18,1\nCaio Cesar Moreira De Oliveira,2021-11-18,1\nEraldo Zaneratto,2021-11-18,1\nEraldo Zaneratto,2021-11-18,1\nCaio Cesar Moreira De Oliveira,2021-11-18,1”,
“customfield_age_is”: 1637166829,
“customfield_all_links”: “”,
“customfield_modgr”: “Team OPE II”,
“customfield_sumry”: “Erro ao processar arquivo Faturamento Pecas VW”
}
}

Hi @Fabio.Santos ,
You need to add this code to eazyBI advanced settings and not in import additional settings. Delete the code from additional settings and copy it here:

If you don’t have this option, then you need to contact your Jira/eazyBI admin as only they have this right to add JavaScript customfield to eazyBI advanced settings.

best,
Gerda // support@eazyBI.com

1 Like

Thank you @gerda.grantina!

This suggestion resolved my request.

:clap: :clap: :clap:

1 Like