Data Import Error

The following error occurs when importing data.
eazybi-private 6.3.0
image

###import scrit
[source_application.jira.site_itro.customfield_wlsystem]

name = “WL-System”
data_type = “string”
dimension = true
worklog = true
javascript_code = ‘’’
console.log(“Issue Key :” + issue.key);
console.log("#Worklog : " + issue.fields.worklog.total);
var cntWls = issue.fields.worklog.total;

if (cntWls > 0) {
    var iter = issue.fields.worklog.worklogs;
    for (var key in iter) {
        var url = "/rest/scriptrunner/latest/custom/getIctWorklog?worklogid=" + iter[key].id;         
        var result = getDocument(url, {ignoreErrors: [404]});

        if (result.length > 0) {
            if( result[0].WLA_DISPLAY_VAL1 ){
                issue.fields.worklog.worklogs[key].customfield_wlsystem = result[0].WLA_DISPLAY_VAL1;
                console.log("System : " + result[0].WLA_DISPLAY_VAL1);
            }
        }            
    }
}

‘’’

Hello,

I see that you are using a custom REST API endpoint method getIctWorklog and passing worklogid, and this is done in the loop for every record in the worklogs.

Could it be possible to change the REST API endpoint to be able to pass an array of worklog IDs and calling this REST only once before the for loop, therefore dramatically reducing import time?

If this is possible you could construct the JavaScript code based on our example in documentation using the postDocument method and passing issue fields worklog IDs as attributes.

Let me know if you need our further assistance!
Best regards,
Janis Liepa / eazyBI support