Hi,
based on this article https://thepluginpeople.atlassian.net/wiki/spaces/JEMH/pages/49676406/Prevent+inhibit+sending+of+a+notification+Issue+Event+or+Postfunction
I use postfunction to send email to customer. I want send email to customer only if added comment is Respond to customer if my user add Internal comment email shouldn't by sent.
I try do this by added this function to my Adhoc template but it doesn't work.
#set ($commentPropertyService = $ComponentAccessor.getComponent(CommentPropertyService))#set ($commentProperty = $commentPropertyService.getProperty($remoteUser.getKey(), $comment.getId(), SD_PUBLIC_COMMENT).getEntityProperty().getOrNull().getValue())#if($commentProperty.toString().contains("false") )$jemhUtils.setInhibitSending(true)$jemhUtils.setInhibitSendingReason("Comment is empty")#elseMy template #end
#set ($commentPropertyService = $ComponentAccessor.getComponent(CommentPropertyService))#set ($commentProperty = $commentPropertyService.getProperty($remoteUser.getKey(), $comment.getId(), SD_PUBLIC_COMMENT).getEntityProperty().getOrNull().getValue())#if($commentProperty.toString().contains("false") )$jemhUtils.setInhibitSending(true)$jemhUtils.setInhibitSendingReason("Comment is empty")#else
My template
#end
Hi Tomasz,
Reece from The Plugin People here, can you please raise a support issue with us directly about this? The Plugin People Support
The solution to your requirement will vary based on your current JEMH/Jira version so please do get in touch and we can provide the appropriate solution.
Kind regards,
Reece
Hi @[deleted]
I solved this problem differently.
I wrote a script in groovy, which checks whether the added comment is internal or not. If not, set the value of the field in the issue to 1. In the template I check the value of this field and on its basis decide whether to send a notification to the customer
It looks like you're new here. Sign in or register to get started.