Reference Error "jira" is not defined

Hi!

When I am trying out some custom JavaScript code, I get an error stating: “Execution of custom JavaScript code raised the following error: ReferenceError: “jira” is not defined.”

I have inputted the following JavaScript code:
[jira.customfield_descr]
data_type = “string”
if (issue.fields.summary) {
issue.customfield_descr = “test”;
}

Do any of you know why I am receiving this error?

Hi @Ruth

When testing JavaScript in import options tab “Additional options”, paste only the JavaScript code without advanced settings.

if (issue.fields.summary) {
  issue.customfield_descr = “test”;
}

When the code is tested on individual issues, you are ready to create a JavaScript-calculated custom field in eazyBI advanced settings. Now add the advanced setting parameters representing custom field identifier (jira.customfield_descr), name, data type and javascript_code:

[jira.customfield_descr]
name = "Description"
data_type = "text"
json_fields = ['description']
javascript_code = '''
if (issue.fields.description) {
  issue.fields.customfield_descr = "test";
}
'''

Here are more details on how to test JAvaScript calculated custom fields: JavaScript calculated custom fields.

If you are interested in the issue description field, please see the documentation with the example and this Community post:

Best,
Zane / support@eazyBI.com