Create calculated field for specific issue types

I have a custom field that exists on only tasks within my project and not epics. When I try to add a calculated field it works when I test it on a task but when I test it on an epic I get an error message. See attached image. How can I configure this calculated field so that it will work within my project? For ex. for epics it could be blank or show as “N/A”

Is anyone able to share any tips on correcting this problem?


The Javascript code should check the presence of the custom field before accessing the name field:

if (issue.fields.customfield_10001 &&

Janis, eazyBI support