Leveraging Intelligent Recommendations for Operational Transformation. AMS Partners click HERE | EMEA/APJ Partners click HERE |
10/11/2023 12:52 PM
Hi Team,
We are trying to print request attributes in email template from the form. we need right syntax to use it email template subject. We are using the below conditions
if (request?.requesttype == 18) New Joiner Request ${requestid} has been rejected.
else if (request?.requesttype == 19 and if customproperty44 contains Leaver) then Leaver Request ${requestid} has been rejected.
if (request?.requesttype == 19 and if customproperty44 contains Mover) then Mover Request ${requestid} has been rejected.
if (request?.requesttype == 19 and if customproperty44 contains Update) then User Update Request ${requestid} has been rejected.
The Customproperty44 is taken from request attributes and also we tried below condition but it shows syntax error
<% if (request?.requesttype == 18) print "New Joiner Request ${requestid} has been rejected." else if ((request?.requesttype == 19 && ${accessItems.collect{ it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('customproperty44')}.collect{it.attributeValue}}.get(0).join(', ')}.contains('Leaver')) print "Leaver Request ${requestid} has been rejected." %>
Can someone help me with right syntax?
10/11/2023 02:22 PM - edited 10/11/2023 02:30 PM
@Bhargav : Are you talking about Workflow emails or task emails? If it is workflow email try below
<% if (request?.requesttype == 18) print "New Joiner Request ${requestid} has been rejected." else if (request?.requesttype == 19 && ((accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('customproperty44')}.collect{it.attributeValue}}).contains('Leaver'))) print "Leaver Request ${requestid} has been rejected." %>
10/11/2023 08:32 PM
Hi Sk,
yes it's for workflow emails only.
And the above condition shows syntax error.
10/12/2023 08:12 AM
10/12/2023 11:30 AM
Hi Sk,
The template is not getting saved, and getting below error.
10/12/2023 01:44 PM
10/11/2023 02:41 PM
@Bhargav
There is a syntax error in the condition.
10/11/2023 08:40 PM
can you help me out on this?
10/11/2023 08:59 PM
Hi @Bhargav
can you try below expressions in your email template.
${request.requesttype}
In case above not worked then try ${requesttype}