You are not logged in.
Pages: 1
I'm making changes to my ticket notification template and don't see any way to do a proper ELSEIF and the syntax doesn't seem very well documented. I'm trying to do something like:
##IFticket.action=New Ticket##
Blurb for only new tickets
##ENDIFticket.action####ELSEIFticket.action=New Task##
Blurb for only new tasks
##ENDELSEIFticket.action####ELSEticket.action##
Blurb for all other ticket actions, but not for new tickets or tasks
##ENDELSEticket.action##
This doesn't work as elseif doesn't appear to by in the syntax. After a lot of trial and error the closest I could get was doing:
##IFticket.action=New Ticket##
Blurb for only new tickets
##ENDIFticket.action####ELSEticket.action####IFticket.action=New Task##
Blurb for only new tasks
##ENDIFticket.action####ELSEticket.action##
Blurb for all other ticket actions, but not for new tickets or tasks
##ENDELSEticket.action####ENDELSEticket.action##
This seems to work fine for new tasks and everything else but includes the text "##ENDELSEticket.action##" in the notification for New Tickets.
Is there a way to nest an IF and ELSE inside an ELSE without running into this kind of problem. Or is there another way to get an ELSEIF kind of behavior so you can have multiple specific IFs followed by an ELSE. I suppose if I really need to I could just create an IF for every single possible ticket action with most of them having duplicate contents, but I'd like to avoid that if I can.
Any thoughts or documentation I'm missing?
Thanks, Wickeret
Offline
The syntax for this is just "ELSE" and "ENDELSE". "ELSE" does accept a condition.
##IFticket.action=New Ticket##
Blurb for only new tickets
##ENDIFticket.action####ELSEticket.action=New Task##
Blurb for only new tasks
##ENDELSEticket.action####ELSEticket.action##
Blurb for all other ticket actions, but not for new tickets or tasks
##ENDELSEticket.action##
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Thank you so much. This is exactly what I needed.
Offline
Pages: 1