ALERT! The community will be read-only starting on April 19, 8am Pacific as the migration begins. Read more for important details.
ALERT! The community will be read-only starting on April 19, 8am Pacific as the migration begins.Read more for important details.
Absent Member.
Absent Member.
9899 views

Conditional logic in notification template?

Jump to solution
I need a way to change a repeating notification email (subject OR body) based on whether it's the initial message or any subsequent message. Something similar to the following, which (is not documented and) does not work:

$IF ( $REPEATCOUNTER() == 0 )
$BEGINSUBJECT()INITIAL TASK NOTIFICATION ------ Issue Number $INCIDENTNUMBER()$ENDSUBJECT()
$ELSE()
$BEGINSUBJECT()DUE TASK REMINDER $REPEATCOUNTER() ------ Issue Number $INCIDENTNUMBER()$ENDSUBJECT()
$ENDIF()

Thanks in advance...

P.S. I've also tried:

$IF ( $REPEATCOUNTER() = 0 ) and
$IF ( $REPEATCOUNTER() )
0 Likes
1 Solution

Accepted Solutions
Absent Member.
Absent Member.
OK, with some guidance from Steven Healy in Serena support, this has been solved using an escalation. In a nutshell, I wanted to send an initial notification with using one email header/body, and then 30/60/90/... days from the initial notification, I wanted to start sending reminder notifications using a different email header/body. I convinced myself that I needed a conditional template, as the OP reflected. Instead, the solution was simple, and I should have thought of it:

1. Create initial notification rule, notification, and template. This notification does not repeat.
2. Create a termination rule for the next step.
3. Escalate the notification from step 1 after 30/60/90/... days. This escalation spawns a different notification, with a DIFFERENT template.
4. Make this notification repeat every 30/60/90/... days until the termination rule is satisfied.

View solution in original post

0 Likes
4 Replies
Absent Member.
Absent Member.
Interested in any answers here as well.

Have you tried in the style of the supported "ITEMTYPE" if condition?

$IF(REPEATCOUNTER, 0)
0 Likes
Fleet Admiral
Fleet Admiral
Just an idea to try
Add your Repeat Counter field and default to 0
Add a Quick "no-button-on-form" transition that increments the Repeat Counter
When you want to start the Notification process set the Repeat Counter to 1.

Create a pair of Notifications using a Rule that detects "When Repeat Counter changes to 1". This Rule will need to be something like "When Repeat Counter Changes *AND* When Repeat Counter=1".
First Notification sends the email using a "First Notification" template.
Second Notification runs the "Increment Counter" transition to change the counter to 2. This prevents the "Repeat Counter changes to 1" Rule from firing again.

Another Notification has a Rule "When Repeat Counter changes to 2". This notification repeats and uses a different template to send the subsequent notifications. Termination Rule is "When Repeat Counter changes to 0"

When you want the Notifications to stop, set the Repeat Counter field to 0.
0 Likes
Absent Member.
Absent Member.
OK, with some guidance from Steven Healy in Serena support, this has been solved using an escalation. In a nutshell, I wanted to send an initial notification with using one email header/body, and then 30/60/90/... days from the initial notification, I wanted to start sending reminder notifications using a different email header/body. I convinced myself that I needed a conditional template, as the OP reflected. Instead, the solution was simple, and I should have thought of it:

1. Create initial notification rule, notification, and template. This notification does not repeat.
2. Create a termination rule for the next step.
3. Escalate the notification from step 1 after 30/60/90/... days. This escalation spawns a different notification, with a DIFFERENT template.
4. Make this notification repeat every 30/60/90/... days until the termination rule is satisfied.

View solution in original post

0 Likes
Absent Member.
Absent Member.
Thanks, Paul. It sounds like something that would work. I'm just not sure I want to invest in such a heavy solution for something IMO should be out of the box.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.