If you use eazyBI for Jira Server and wish to import custom fields provided by Checklist for the Jira app, you could find this thread useful.
To import all items from the checklist field, you could use this code in your advanced settings: (use Jira custom field ID instead of NNNNN in following codes)
#all items as comma separated string from Checklist
[jira.customfield_NNNNN]
data_type = "text"
name = "Checklist items all"
The next code would let you import a comma-separated list of only checked items from the field:
#only checked items from the custom field - comma saprated list
[jira.customfield_chlnames]
name = "Checked item list"
data_type = "text"
javascript_code = '''
if( issue.fields.customfield_NNNNN){
var result =
getDocument("/rest/api/latest/issue/" + issue.key +"?fields=customfield_NNNNN");
var resultArray = [];
if (result){
for(x of result.fields.customfield_NNNNN){
if(x.checked)
{
resultArray.push(x.name)
}
}
issue.fields.customfield_chlnames = resultArray.join(",");
}
}
'''
The first two fields when imported as properties would let you see the details per issue level.
The last code would create an integer number that would count the checked items in your CHecklist field. This field can be imported as measure and used in report to count checked items in other hierarchy levels or even when “Issue” dimension won’t be used in the report.
#counts only checked items and imports as measure
[jira.customfield_chlcheckedcount]
name = "Checked item count"
data_type = "integer"
measure = true
javascript_code = '''
if( issue.fields.customfield_NNNNN){
var result =
getDocument("/rest/api/latest/issue/" + issue.key +"?fields=customfield_NNNNN");
var counter = 0;
if (result){
for(x of result.fields.customfield_NNNNN){
if(x.checked)
{
counter++;
}
}
if(counter>0) {issue.fields.customfield_chlcheckedcount = counter;}
}
}
'''
Where do you see such a dimension with one value (by commas) in my screenshot?
There is a workaround to import the field as a multi-value dimension, but you should be careful with multi-value dimensions as issues can be double-counted.
What is the use-case? Why would need to separate values as unique dimension members? What do expect to calculate per each “True” value?
What code have you used in advanced settings to define this dimension?
My example above doesn’t share details on how to import the checklist field as dimension.
You can import dimension with multiple_values = false condition, but it would require double import if the field is already imported without this setting.
Please provide exact code you used to define dimension and I will help you modify it to import each value as separate member.
In this case, here is what you can try the following steps:
open import options and unselect the field “DOR Select” and import data without it. Wait while import finishes. That will drop the field from the database with your current advanced settings
I tried the script you sent me, but I still get the same error.
I also tried the “if(issue.fields.customfield_12001){}” condition within all the section under “if (result) {}” but still no success :-/
Do you see any values for issues when selecting the property “Issue Acceptance Criteria” from Measures dimension in columns, and “Issue” dimension members (at issue-level) in report rows?
Is Acceptance criteria field correctly imported?