v7.1 v7.0 v6.4 v6.3 v6.2 v6.1 v6.0 v5.0 latest <= v4.0 Cloud Data Center
v7.1 v7.0 v6.4 v6.3 v6.2 v6.1 v6.0 v5.0 latest <= v4.0 Cloud Data Center

Receiving “Type null does not have any properties“ error

Often, you want to check some sub-property of an element, for example, the display name of the assignee. In this case, you would write something like:

JavaScript
issue.assignee.displayName != "John Doe"

However, if the issue is currently unassigned, this will result in an error. You can fix this by checking that an assignee is set for the issue explicitly:

issue.assignee != null && issue.assignee.displayName != "John Doe"

Note that setting a field to hidden in a field configuration (i.e. disabling the field) will result in the corresponding field evaluating to null, which could also result in this error.