jbostoen / itop-jb-mail-to-ticket-automation-v2

Originally a fork of Combodo's Mail to Ticket Automation, enriched with some new features. Also contains some bug fixes.
https://jeffreybostoen.be
6 stars 3 forks source link

Ticket Default Values : Date #17

Closed w452m200 closed 2 years ago

w452m200 commented 2 years ago

Hello,

Can't set Ticket Default Values for start date

start_date:mail->date start_date:$mail->date$

not working

jbostoen commented 2 years ago

Thanks for pointing this out!

It indeed only worked for the default values of a person and in some other cases; but it should work for ticket default values now. I also noticed and double checked a mistake in the documentation, it should be ´$mail->date$´ (so dollar sign at the end).

It's only available in the "master" branch for now, I haven't updated the "Releases" yet. But "master" branch is stable at the moment.

https://github.com/jbostoen/itop-jb-mail-to-ticket-automation-v2/commit/2bbd2643d3be8346d6cc1b89523e9269937d931c#

Do mind that it is possible that iTop sets/overrides some attributes in some cases. I haven't tested it but I did quickly check the default iTop XML Datamodel; it seems "start_date" is automatically set to the date the ticket is created in iTop itself if there's no value defined yet. So it should work fine for you 😁

And perhaps a last note for this specific case: I also haven't tested yet if the date will be returned in a consistent manner. In my case, I live in GMT +1. I do see the same time I see in my Outlook mail client (which is however different from the email source header which uses a different time zone). I believe it will be fine if you configure the timezone correctly in PHP and in the iTop configuration file.

I had to look at Combodo's original code which is still present in this fork; the time is formatted using the date() function in PHP and is hardcoded to be formatted as Y-m-d H:i:s .

w452m200 commented 2 years ago

Thank you, works fine

jbostoen commented 2 years ago

Thanks for confirming!