Some how I found that issue but now other issue comes up. following is the code I verified, one entity is missing in that code thats why its showing exception, just because two rest api is used.
Also I got one solution but not sure how can I embed that solution in it.
<#case 'mentions'>
<#assign date = relativeOrAbsoluteDate( notification.target.time_stamp ) />
<#if notification.target.entity.subject??>
<#assign subject = truncateMaybe(notification.target.entity.subject) />
<#assign link = notification.target.entity.@view_href />
<a href="${link}">
<h4>${notification.target.actor.login},
${text.format('pdc6.notifications.mentioned_string')},
${subject?string}</h4>
<div class="details">
<b class="notification-icon mono-icons-bg notification-mention"></b> ${date}
</div>
<#else>
<#return 1 />
</#if>
</a>
<#break>
Following is the error:
evaluated to null or missing: ==> truncateMaybe(notification.target.entity.subject)
Solution for this:
Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>
Complication: Iam not able to set condition for this. As per tip.