Getting checked Acceptance Criteria into EazyBi

We use Checklist for Jira (DataCenter) and I was hoping to display checked AC’s through EazyBI. We’re using EazyBI version 8.0.2.

Initially I created a JavaScript Calculated custom field to fetch the data. The script used
GetDocument(“/rest/api/katest/issue/“ + “issue_key +”?fields=customfield_17xxx”). That is the ID of the AcceptanceCriteria custom field.

This led to an HTTP 429 error because it was making a separate call for each issue.

I attempted to use the field using field_options without JavaScript, but the Acceptance Criteria does not return as checked or unchecked.

Is there a recommended method to get the acceptance criteria into EazyBI with the additional information of whether it is checked (completed) or not?

Hi @janedoe2

Thank you for posting your question!

The HTTP 429 error you’re encountering is due to rate limiting in Jira when making multiple REST API calls using the getDocument() function. This is a common issue when importing checklist data, as each issue requires a separate API call to retrieve the checklist details.

Here are some options you may try:

If you have multiple JavaScript calculated fields that each use getDocument() for the same checklist field, you can consolidate them into a single field to reduce API calls. For example, replacing parts a custom field ID with the correct ID of your field:


[jira.customfield_chlnames]
name = "Checked AC item list"
data_type = "text"
javascript_code = '''
if( issue.fields.customfield_17xxx){
var result =
getDocument("/rest/api/latest/issue/" + issue.key +"?fields=customfield_17xxx");
var resultArray = [];
if (result){
for(let x of result.fields.customfield_17xxx){ //generate value list
if(x.checked)
{
resultArray.push(x.name)
}
}
issue.fields.customfield_chlnames = resultArray.join(",");
var counter = 0;
for(x of result.fields.customfield_17xxx){ //count checked items
    if(x.checked)
    {
    counter++;
    }
}
if(counter>0) {
    issue.fields.customfield_chlcheckedcount = counter;
}
}
}
'''

#counts only checked items and imports as measure
[jira.customfield_chlcheckedcount]
name = "Checked AC item count"
data_type = "integer"
measure = true

As a last resort, you can ask your Jira administrator to adjust the rate limiting settings in Jira System settings → Rate limit configuration

You may check more on this topic here: https://developer.atlassian.com/cloud/jira/platform/rate-limiting/ and ask your Jira admin if the error could be avoided with Rate limit configuration on the Jira side (System settings->Rate limit):

Best wishes,

Elita from support@eazybi.com

Thank you. I tried this, and I received an error message:

“Cannot import ‘text/data/datetime’ type custom field ‘customfield_check_ac’ as dimension.

When I changed the data type to string, I can see that the Dimension checkbox is not checked. I also tried making it an integer and it returned the same error

@Elita.Kalane - Any update here?

Hi @janedoe2

Apologies for the delayed response; I missed your reply.

Try adding these additional 3 lines in the code and change the data_type to “string” and then see if you’re able to import the field as dimension.

data_type = “string”
dimension = true
multiple_values = true
split_by = “,”

Best wishes,

Elita from support@eazybi.com

Unfortunately, this didn’t work. Error and code snippet below

[jira.customfield_chlnames]
name = "Checked AC item list"
dimension = true
multiple_values = true
split_by = ","
data_type = "string"
javascript_code = '''
if( issue.fields. customfield_17600){
var result =
getDocument("/rest/api/latest/issue/" + issue.key +"?fields= customfield_17600");
var resultArray = [];
if (result){
for(x of result.fields. customfield_17600){ //generate value list
if(x.checked)
{
resultArray.push(x.name)
}
}
issue.fields.customfield_chlnames = resultArray.join(",");
var counter = 0;
for(x of result.fields. customfield_17600){ //count checked items
    if(x.checked)
    {
    counter++;
    }
}
if(counter>0) {
    issue.fields.customfield_chlcheckedcount = counter;
}
}
}
'''

#counts only checked items and imports as measure
[jira.customfield_chlcheckedcount]
name = "Checked AC item count"
data_type = "string"
measure = true

@Elita.Kalane

The function is now returning the Acceptance Criteria, however, it’s returning all of them, and not indicating which are checked. I have a new measure called “Checklist Acceptance Criteria”, and a new measurement to reflect the custom field we created.

Hello @janedoe2

I will show step by step the scenario of 2 issues where I have some options selected for the checklist field. Please start from scratch (unselect the fields you imported, import data and then wipe the settings you added) , trying to replicate the same, and see if you can see the same results.

Please also advise on the expected report at the end, so I can help with utilizing the imported measure and properties defining new caclulated measures with MDX.

This is how one of my Jira items look with two checklists fields selected. The ID of my checklist

Step 1: add the below JS codes in eazyBI advanced settings.This is an example for my checklist field with custom field ID customfield_19400. Replace the customfield customfield_19400 with the ID of your checklist customfield ID

#all items as comma separated string from Checklist

[jira.customfield_19400]
data_type = "text"
name = "Checklist items all TEST"

#Only checked items as comma separated string from Checklist

[jira.customfield_chlnames]
name = "Checked AC item list"
data_type = "text"
javascript_code = '''
if( issue.fields.customfield_19400){
var result =
getDocument("/rest/api/latest/issue/" + issue.key +"?fields=customfield_19400");
var resultArray = [];
if (result){
for(let x of result.fields.customfield_19400){ //generate value list
if(x.checked)
{
resultArray.push(x.name)
}
}
issue.fields.customfield_chlnames = resultArray.join(",");
var counter = 0;
for(x of result.fields.customfield_19400){ //count checked items
    if(x.checked)
    {
    counter++;
    }
}
if(counter>0) {
    issue.fields.customfield_chlcheckedcount = counter;
}
}
}
'''

#counts only checked items and imports as measure
[jira.customfield_chlcheckedcount]
name = "Checked AC item count"
data_type = "integer"
measure = true

Step 2: Select the field for import. In my example:

Checked AC item count - imported as measure and property will return a count of how many checked options are for the issue

Checked AC item list - all the checked options from the checklist for the issue. Imported as property

Checklist items all TEST - all the available checklist options for the issue. If you don’t need to see this information, you don’t have to import it

Step 3. Once you import the fields, you should be able to access new measures and properties.

Please let me know if you are able to replicate the same steps. And as mentioned above - advise on your reporting needs, so I can suggest an MDX calculated measure by using the available properties and measures imported, to achieve the required results

Best wishes,

Elita from support@eazybi.com

I’m just looking to include Acceptance criteria which has been checked into a report.
The format would be:

Jira-ID|Description|Status|Deliverables

The checked acceptance criteria (and only the checked values) would show up under the Deliverables measure. The custom field as it exist now, returns all the criteria without indicating if it’s checked, separated by “,”

Here’s where we are now:

When I put in those values, I receive the following:
”Cannot import ‘text/date/datetime’ type custom field as dimension”. I can see there is a difference between what the custom field’s default value is “Integer” and what we’re assigning it, first as a string according to the admin defined settings, and then as text as we define it.

When I change it to “string” as indicated as before, I get
”Cannot import ‘string/text’ type custom field as measure”

Hello @janedoe2

Thanks for the screenshot.

You should add the JavaScripts I shared in the general eazyBI advanced settings and not at the account level. Here is a documentation regarding how you can access the general advanced settings - Advanced settings for custom fields

Here is a screenshot as well

Best wishes,

Elita from support@eazybi.com

Is this at all possible at the account level? Are the datatype errors I’m receiving due to the fact that this is at the account level?

Hello @janedoe2

In this case, you cannot define these fields at the account level. When you want to import an additional Jira custom field (such as Checklist) that is not supported by default, you need to add the JavaScript in the general eazyBI advanced settings for eazyBI to recognize the field.

If you don’t have access to these settings, please reach out to your Jira admin to have them added there. Once they are added in the settings, you will be able to see the fields in the import options.

Best wishes,

Elita from support@eazybi.com

Hi @Elita.Kalane

Unfortunately, this solution is not going to work. I reached out to our administrators, and they entered the code globally, and we were greeted with the 429 rate limiting errors.
We did have two questions as a result of this.
1). The error message we recieved cad the api calling localhost instead of the JIRA URL. Is there a way we can send the endpoint with a FQDN instead of just the /rest endpoint
2) They suggested this might work if we were able to adjust this function to use /search ( Jira 9.14.0 ) endpoint instead of the get.

Hello @janedoe2

Have you considered adjusting the rate-limiting settings in Jira? If you scroll up to my initial response, you should also see a screenshot and link to the Atlassian documentation regarding this

eazyBI doesn’t have native integration with the Checklist for Jira app. The JavaScript approach we’ve been exploring is essentially a workaround that requires additional calls to retrieve the checklist data structure, which is why you’re encountering the rate-limiting issues

Could you please share approximately how many issues do you have in your current eazyBI account/cube where you are attempting to import these fields? If you don’t want to share this on the Community here - you can reach out to us directly (support@eazybi.com) referring to this community post.

The reason I ask is because if you have hundreds of thousands of issues imported, but you actually want to report on a much smaller issue set, you may consider creating a new account that imports only a subset of issues (e.g., specific projects, issue types, or date ranges. This would significantly reduce the number of API calls needed.

Best wishes,

Elita from support@eazybi.com