I’m getting this error when try to add a custom Javascript code:
Execution of custom JavaScript code raised the following error: unterminated string literal
the code that I’m using:
[jira.customfield_mpc_e]
name = "Epic MPC Type name"
data_type = "string"
dimension = true
update_from_issue_key = "epic_key"
javascript_code = '''
if(issue.fields.customfield_17704 ) {
issue.fields.customfield_mpc_e = issue.fields.customfield_17704;
}
'''```
I can't see the mistake
The javascript_code should end with three apostrophes as it started, like this '''.
The given code example ends with 3 apostrophes and then there are added 3 extra unsupported characters ```. Delete the last 3 and the code should work correctly.
In import options, field “Custom JavaScript code”, you should paste in only the javascript_code part without other properties of advanced settings and with out opening/closing apostrophes enclosing the code (see picture below)
When you have tested the javaScript code in import options, you can clear it from there.
The code validation is done.
Got to eazyBI advanced settings (eazyBI >> System administration >> Settings >> tab Advanced settings) and paste the settings with dimension name, data type, and javascript code there (Advanced settings for custom fields).
Then go back to import options, tab Custom fields, the new custom field “Epic MPC Type name.”
should be there. Select it for data import as property and dimension and Import data (Jira custom fields).
@ivera, you might want to check how the custom field “MPC Type” is stored for epic issues in JSON format and whether it is visible in eazyBI. And adjust the settings accordingly.
In Jira, find one epic that has value for “MPC Type.”
Go back to eazyBI import options, tab “Additional options”, and validate what information you can see about this epic. Enter only the epic issue key in “Test custom javaScript code with the issue” and leave the “Custom JavaScript code” field empty.
Check how the customfield_17704 look in the JSON format. Is value available? Does the field have several parameters like id, name and value?
Hi Zane! You were right, I’m not receiving the customfield_17704 in EazyBI. Something weird is that customfield_17900 is also a select list field and has a value as 17704.
There is something that I can do to bring that field to eazybi?
@ivera, eazyBI does not receive data of the customfield_17704 and therefore its value is not inherited also for epic child issues. It might be that this custom field has a data type that is not recognized by eazyBI and therefore it is not received.
You may enable such custom fields by defining a data type for the cutom field in eazyBI advanced settings. If a custom field contains a textual value, the settings might look like this:
I have tested the code for pulling the last comment date and it worked just fine, but when I tried to add it as a custom field through Advanced Settings, there are two persistent errors: Missing “return” and then Execution of custom JavaScript code raised the following error: unterminated string literal. Even though my testing is working correctly, it is still having the same problem over and over again.