Latest JSM customer comment date
eazyBI for Jira
Import the date when the last comment was added to an issue by a Jira Cloud customer from the Jira Service Management (JSM) customer portal. You can use the measure Issues with Latest JSM customer comment date to count issues by date of the latest customer comment in particular period from "Time" dimension.
Account-specific calculated field
Account specific calculated fields are defined in Source Data → Import options.
Settings for the new field
Internal name | lastcustcomdate |
---|---|
Display name | Latest JSM customer comment date |
Data type | datetime |
Measure | ✓ |
Additional advanced settings | json_fields = ["comment"] #this line is mandatory |
Custom JavaScript code:
var commentd; var allcomments = issue.fields.comment; if (allcomments && allcomments.comments) { var comments = allcomments.comments; for (var i = comments.length - 1; i >= 0; i--) { var comment = comments[i]; // Filter by author type: customer if (comment.author.accountType === "customer") { commentd = comment.created; break; } } } return commentd;
Global calculated field
Global calculated fields are defined in eazyBI advanced settings.
Here are the settings for the new field definitions. You should insert the JavaScript (the code given above) below the line // Insert here the Custom JavaScript code
. Keep the opening and closing quotation marks. '''
, do not delete them.
[jira.customfield_lastcustcomdate] name = "Latest JSM customer comment date" data_type = "datetime" measure = true json_fields = ["comment"] #this line is mandatory javascript_code = ''' // Insert here the Custom JavaScript code '''