It's all about the answers!

Ask a question

Email notification template in RTC.


Pallavi Deore (38150) | asked Aug 22 '18, 7:10 a.m.
retagged Oct 01 '18, 12:45 p.m. by Michael Afshar (7014)

Hi,


I am using CLM 5.0.1.
I have created 2 different email templates, one email template for all work item state change except state In progress to completed and 2nd email template for state change In progress to completed.
Is there any possibility to send mail for state change notification using 2 different email template?


2 answers



permanent link
Dinesh Kumar B (4.1k413) | answered Aug 22 '18, 7:52 a.m.
JAZZ DEVELOPER
edited Aug 22 '18, 7:59 a.m.
No, only one template can be configured for work item change notification.  Same is the case with other events, each event has one template associated.

The scenario you describe seems like you do need a notification on both cases but the content you wish to include is specific to the cases.  You can customize the template to generate different content based on the conditions you have.

 

A simple if else clause could be used to get it. There are a set of variables you can use with Velocity syntax. 
 
To get the work item state, use :
${workItem.state}
a simple if clause would look like this :
#if($foo == $bar)it's true!#{else}it's not!#end
For more details, you can refer to this Reference section from CLM Help, here is a quick link for you :

hope this helps


permanent link
Snehal Yendhe (15235) | answered Aug 28 '18, 3:30 a.m.
edited Sep 27 '18, 3:51 a.m.

 Hi Dinesh,


             Actually I want to send mail for state change notification when 1. state change in progress to complete and  2.  state change except state In progress to completed.  As per above instruction I used "if else", but getting error.

I used below template   :

<html>  <body> 
#if( ${workItem.state} == "Completed" )   #set($workItem.get("channelstatus")="Dropped")#end 
A new form (CM):${workItem.title}(${workItem.identifier}) has been modified on ${workItem.created.fullDate} ${workItem.created.fullTime} India Standard Time. Please provide all necessary inputs.
<br>Requirement originator :${workItem.owner}</br>
<br>State of request : ${workItem.state}</br>
<br>Title of the  request :${workItem.title}</br>  
<br>email ID:#if(${change.contributor.emailAddress})&nbsp;${change.contributor.emailAddress}#end </br>#end
#else( ${workItem.state} == "draft" ) 
A new channel master form (CM):${workItem.title}(${workItem.identifier}) has been created on ${workItem.created.fullDate} ${workItem.created.fullTime} India Standard Time. Please provide all necessary inputs.
<br>Requirement originator :${workItem.owner}</br>
<br>State of request : ${workItem.state}</br>
<br>Title of the  request :${workItem.title}</br>  
<br>email ID:#if(${change.contributor.emailAddress})&nbsp;${change.contributor.emailAddress}#end </br>#end 
</body></html>

   Error:  
Parse error
Encountered "#end\n" at line 8, column 103 of template 
Was expecting one of: 
<EOF> 
"(" ... 
<RPAREN> ... 
<ESCAPE_DIRECTIVE> ... 
<SET_DIRECTIVE> ... 
"##" ... 
"\\" ... 
"\" ... 
<TEXT> ... 
"#" ... 
"
#" ... 
<STRING_LITERAL> ... 
<IF_DIRECTIVE> ... 
<STOP_DIRECTIVE> ... 
<INTEGER_LITERAL> ... 
<FLOATING_POINT_LITERAL> ... 
<WORD> ... 
<BRACKETED_WORD> ... 
<IDENTIFIER> ... 
<DOT> ... 
"{" ... 
"}" ... 


Comments
Dinesh Kumar B commented Aug 31 '18, 4:08 a.m.
JAZZ DEVELOPER

please check the line 8, column 103 of your template code.. its not in right form... there #end which is not right at that place... please refer to the velocity syntax, there is more to change in the template...

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.