Hi there community,
I have a project that captures feedback in a custom issue type and I want to generate reports from it that groups issues together where it detects certain similarities or keywords in the description or summary.
Has anyone done something like that before? Any tips?
Hi @cokefour,
The critical part is to understand the text pattern for linked issues. Usually, those are project KEY followed by a dash and number, like ABC-3456
. Then, you can create a code that would search for this pattern and get out the linked issue keys.
The best approach woudl be to create a JavaScript calcauted field that would check on the issue summary and description and look for issues keys. This way, you can create a dimension that groups all linked issues mentioned in the description or summary and show this relation in the report.
-
Go to the import options tab, Custom fields, and choose “Add new calculated field”.
-
Set up the new field with the following options:
- Internal name: descr_link
- Display name: Linked Issues From Description
- Data type: string
- Dimension: checked
- Multiple values: checked
-
In the Additional advanced settings, enter the parameter that allows eazyBI to access the issue description:
json_fields = ["description"]
-
In the Custom JavaScript code section, use the following code:
//define functionn to look for linked issue key pattern function findIssueKey(text) { if (!text) { return []; } //issue key patter to look for "AAA" or BBB project key following with numbers like AAA-3456 and BBB-1234 let matches = text.match(/(AAA|BBB)-\d+/g); return matches ? matches : []; } var allMatches = []; //check the summary field if (issue.fields.summary) { // Concat arrays instead of pushing to avoid nested arrays allMatches = allMatches.concat(findIssueKey(issue.fields.summary)); } //check the description field if (issue.fields.description) { allMatches = allMatches.concat(findIssueKey(issue.fields.description)); } //unified set of linked issues from ABC project without duplicates return Array.from(new Set(allMatches));
Replace
AAA
andBBB
with the project keys of linked issues. -
Save the new calculated field and select it as dimension and property for data import.
The calculated field configuration should look like below:
More details on Javascript-calculated fields are described here: Account specific calculated fields
Best,
Zane / support@eazyBI.com