Jira integration - data import - java script - common dictionary/array


We have the integration with the Jira-server and implement several calculated custom fields during data import (Advance settings).
One script == 1 additional custom field
Is it possible to create an array (i.e., hard coded or make one additional API call to get some additional data) and use this created array for all scripts?

please, could you explain it? or any workaround

Thank you ahead


It is possible to use the common Javascript code section in the advanced settings to define variables that will be available for all Javascript custom fields.

I added the following code settings:

common_javascript_code = '''
var global_array=["aa","bb","cc"];

Now I can refer to this array in the Javascript custom field:

name="Field 1"

You can make the API call to create the global array with the getDocument:

common_javascript_code = '''
 var global_array=[];
  result = getDocument( "/rest/agile/1.0/board/");
  if (result && result.values) {
    for (board of result.values) {


Note, however, the code will be executed for each issue during the data import runtime.


1 Like

After this additional call (during standard Jira data impoty, I got
result as [object Symbol]

in the browser - everything is Ok (json response with data)
if REST API using with code - everything works

please, what is it? Why such a response and How to fix it?