Error when importing custom measurement

When trying to import a custom field and define it as a measurement using custom JS it failed to import and give the following error for each ticket:
Issue PRD-4 import failed: can’t quote Hash

note that when using the test function for the same tickets (in the Advanced settings dialog, the function executed correctly with no error)

The setting we use:

the custom JS we use:
if (issue.fields.customfield_10164 == null)
return 0;
else if(issue.fields.customfield_10164.value == “A”)
return 40;
else if(issue.fields.customfield_10164.value == “B”)
return 20;
else if (issue.fields.customfield_10164.value == “C”)
return 10;
else if (issue.fields.customfield_10164.value == “D”)
return 5;
else
return 1;

Never mind. Instead of trying to change an existing field I switched to create a new custom field with the same exact code and it worked

1 Like