You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2012-10-10 15:03:20

FBohnen
Member
From: Manching, Bavaria, Germany
Registered: 2009-02-19
Posts: 113

Tags in Notification Templates

Hello,

we're trying to build some new Notification Templates.

We came across this tags:

##ticket.log.content##
##ticket.log.date##
##ticket.log.field##
##ticket.log.user##

As far as we figured they give back history (log file data)
But, if we put them in a template they don't work.  sad
In the notification the is no data. The only thing you see is the printed tag name

e.g.:

URL : http://xxxxx/index.php?redirect=ticket_263
Beschreibung der Supportanfrage
##ticket.log.content##
##ticket.log.date##
##ticket.log.field##
##ticket.log.user##

Ereignis : Ticket aktualisiert

How are this tags are used? hmm

Frank


Still nuts about GLPI big_smile
Running glpi 0.84.1 on Ubuntu 12.04 LTS
Why are my posts written so poorly: I was the best dyslexic in my class.

Offline

#2 2013-01-08 23:45:50

mdietz
Member
Registered: 2013-01-08
Posts: 1

Re: Tags in Notification Templates

I know it has been a while and you may no longer need this information, but I figured it could be helpful for someone else.

Just like for ticket followups you need to surround those tags by the FOREACH tags.  The following example would show the log history for everyone historical event for the ticket.

##FOREACHlog## 
Time  : ##ticket.log.date## 
By  : ##ticket.log.user## 
Field Updated  : ##ticket.log.field## 
Details  : ##ticket.log.content##
##ENDFOREACHlog##

If you only want to display the last historical event you could change the first line to

##FOREACH LAST log##

In my testing earlier today I also found that the following commands are also valid even though they are not listed anywhere.
This first one displays the number of historical events associated with the ticket

##ticket.numberoflogs##

I also discovered that you can you IF statements to filter out certain fields.  So if I only wanted to historical events pertaining to the status field, I could use the following to filter them out.

##IFticket.log.field=Status##
##ENDIFticket.log.field##

Altogether it would look something like this

##FOREACHlog##
##IFticket.log.field=Status##
Time  : ##ticket.log.date## 
By  : ##ticket.log.user## 
Field Updated  : ##ticket.log.field## 
Details  : ##ticket.log.content##
##ENDIFticket.log.field##
##ENDFOREACHlog##

I discovered these extra commands because I am trying to find a way to display a limited number of historical events, say maybe the last 5.  If anybody else has any suggestions on how to make that happen, I would appreciate the input.

Offline

#3 2013-01-14 14:27:14

FBohnen
Member
From: Manching, Bavaria, Germany
Registered: 2009-02-19
Posts: 113

Re: Tags in Notification Templates

Hello,
we figured it out. But you cleared up some other things.
THX

You can close

Frank


Still nuts about GLPI big_smile
Running glpi 0.84.1 on Ubuntu 12.04 LTS
Why are my posts written so poorly: I was the best dyslexic in my class.

Offline

#4 2013-01-15 06:00:00

numerology report22
Member
Registered: 2013-01-15
Posts: 3

Re: Tags in Notification Templates

No matter the stage in personal evolution, we all seek attraction, attention, and eventually LOVE. For some connectionsnumerology reportthis is simply not possible. It can be rather frustrating not being able to have a good connection with someone over an extended period of time. Especially seeing other couples happy, frolicked and displaying public affection.

Offline

#5 2013-01-15 06:02:46

numerology report22
Member
Registered: 2013-01-15
Posts: 3

Re: Tags in Notification Templates

No matter the stage in personal evolution, we all seek attraction, attention, and eventually LOVE. For some connectionsnumerology reportthis is simply not possible. It can be rather frustrating not being able to have a good connection with someone over an extended period of time. Especially seeing other couples happy, frolicked and displaying public affection..

Offline

#6 2013-01-15 06:07:52

numerology report22
Member
Registered: 2013-01-15
Posts: 3

Re: Tags in Notification Templates

No matter the stage in personal evolution, we all seek attraction, attention, and eventually LOVE. For some connectionsnumerology reportthis is simply not possible. It can be rather frustrating not being able to have a good connection with someone over an extended period of time. Especially seeing other couples happy, frolicked and displaying public affection...

Offline

#7 2013-01-15 06:43:21

Oddur Joakimsson 2013
Member
Registered: 2013-01-14
Posts: 1

Re: Tags in Notification Templates

Then after that what I loved most was having Sandra and Maria hang with me chilling all day everyday.
Then when I went to the college or whatever to call it what I loved most about that was when I had sex with a girl whom I still don’t know her name. Her name was something and I always called her Britney Spears. I lost my virginity toneed womenher. That was my most favorite moment. I was 16 at that time. A year before I had the best moment also when I spent 3 hours kissing Edda, a beautiful girl. I was just too scared to do anything more with her. After this pathetic school system I went to denmark.

Offline

#8 2013-03-22 23:54:22

scharpf
Member
From: Brasil - São Paulo
Registered: 2009-02-26
Posts: 65

Re: Tags in Notification Templates

Realy helpful...  thank you.

mdietz wrote:

I know it has been a while and you may no longer need this information, but I figured it could be helpful for someone else.

Just like for ticket followups you need to surround those tags by the FOREACH tags.  The following example would show the log history for everyone historical event for the ticket.

##FOREACHlog## 
Time  : ##ticket.log.date## 
By  : ##ticket.log.user## 
Field Updated  : ##ticket.log.field## 
Details  : ##ticket.log.content##
##ENDFOREACHlog##

If you only want to display the last historical event you could change the first line to

##FOREACH LAST log##

In my testing earlier today I also found that the following commands are also valid even though they are not listed anywhere.
This first one displays the number of historical events associated with the ticket

##ticket.numberoflogs##

I also discovered that you can you IF statements to filter out certain fields.  So if I only wanted to historical events pertaining to the status field, I could use the following to filter them out.

##IFticket.log.field=Status##
##ENDIFticket.log.field##

Altogether it would look something like this

##FOREACHlog##
##IFticket.log.field=Status##
Time  : ##ticket.log.date## 
By  : ##ticket.log.user## 
Field Updated  : ##ticket.log.field## 
Details  : ##ticket.log.content##
##ENDIFticket.log.field##
##ENDFOREACHlog##

I discovered these extra commands because I am trying to find a way to display a limited number of historical events, say maybe the last 5.  If anybody else has any suggestions on how to make that happen, I would appreciate the input.


GLPI 0.90.1 / OCS Inventory 2.1.2 / OCS AGENTS  v2.1.1.1/ 1500 hosts
Debian Squeeze, Apache/2.2.16, PHP 5.4.45-1~dotdeb+6.1, MySQL 5.1.73

Offline

#9 2013-03-26 11:44:50

tomolimo
Member
From: Grenoble, France
Registered: 2009-05-12
Posts: 515

Re: Tags in Notification Templates

Use the "LAST n" syntax like
#FOREACH LAST 10 log##
if you want to get the last 10 logs

regards,
Tomolimo


GLPI 9.2.4 - PHP 7.2.13 x64 / ProcessMaker 3.3.0-community-RE-1.7 - PHP 7.1.24 x64 / Windows 2012 x64 / IIS 8.5 / MySQL 5.7.17 x64
Worldwide: >12316 PC, >9400 users (16 languages, >11 timezones), >360k tickets, >3600 entities, >4200 groups
Raynet is ARaymond (http://www.araymond.com) IT service management

Offline

#10 2013-03-26 19:27:35

scharpf
Member
From: Brasil - São Paulo
Registered: 2009-02-26
Posts: 65

Re: Tags in Notification Templates

Hi Tomolimo... 
I'm putting this codes in my notification model but the message that I'm receiving is empty...  Like nothing has done...
Did you already experience this behavior?
I try delete and recreate the model but still facing the same problem...  Don't know what else i can do.
Regards.


GLPI 0.90.1 / OCS Inventory 2.1.2 / OCS AGENTS  v2.1.1.1/ 1500 hosts
Debian Squeeze, Apache/2.2.16, PHP 5.4.45-1~dotdeb+6.1, MySQL 5.1.73

Offline

#11 2013-03-26 21:12:17

scharpf
Member
From: Brasil - São Paulo
Registered: 2009-02-26
Posts: 65

Re: Tags in Notification Templates

I figure it out...
For some reason the default notification comes with ##FOREACHtickets## ##ENDFOREACHtickets## (side by side)
I've put this codes again...  this time ##FOREACHtickets## on top and the other at the end, closing the "script"
and
also had to reenter all other codes in the middle... erase, consult the list and retype one by one.
Now it's working... 
Tomolimo...  in your experience, what do you think about this...   I think this is something to be reviewed by developers.

Last edited by scharpf (2013-03-26 21:12:53)


GLPI 0.90.1 / OCS Inventory 2.1.2 / OCS AGENTS  v2.1.1.1/ 1500 hosts
Debian Squeeze, Apache/2.2.16, PHP 5.4.45-1~dotdeb+6.1, MySQL 5.1.73

Offline

Board footer

Powered by FluxBB