Wrong notificaton date format

Moderator: crythias

Post Reply
User avatar
nedmaj
OTRS wizard
Posts: 155
Joined: 26 Nov 2014, 20:34
OTRS Version?: 5.0.17
Real Name: Samuel Casimiro
Company: CD
Contact:

Wrong notificaton date format

Post by nedmaj » 29 Jan 2018, 15:58

Hi guys,

My OTRS agents are brazilians, so they choose "Português - Brasileiro" (pt_BR) at Personal preferences.

The file pt_BR.pm defines the date format as '%D/%M/%Y %T', which is right.

Some notifications have date fields (ex.: <OTRS_TICKET_SolutionTimeDestinationDate>). But when the notification is generated, any date values are formated using '%Y-%M-%D %T' instead.

Is this a [lack of] feature or a bug?

Any ideas to generate the notification using the agent language?

Thanks in advance!
Samuel

OTRS 5.0.17 | OTRS::ITSM 5.0.17
OS: CentOS 6.5 | Database: Oracle 12.1
Reporting: Pentaho | DW Database: PostgreSQL
User database and auth module: LDAP (Active Directory)
Mail server: Microsoft Exchange | Sendmail module: Sendmail
3rd party packages: Yes | SSL: Yes
Number of agents: 450 | Number of customers: 20000 | Number of CIs: 30000

lido
OTRS expert
Posts: 70
Joined: 25 Oct 2017, 16:21
OTRS Version?: 6.0.5

Re: Wrong notificaton date format

Post by lido » 29 Jan 2018, 16:26

Hi,

Not sure, but have you tried creating the notifications also in pt-BR at "index.pl?Action=AdminNotificationEvent"

The default only has en-US notifications so maybe that also fetches the english date format.

User avatar
nedmaj
OTRS wizard
Posts: 155
Joined: 26 Nov 2014, 20:34
OTRS Version?: 5.0.17
Real Name: Samuel Casimiro
Company: CD
Contact:

Re: Wrong notificaton date format

Post by nedmaj » 29 Jan 2018, 17:49

Hi,

Yes. The notification is in pt_BR.

Thanks.
Samuel

OTRS 5.0.17 | OTRS::ITSM 5.0.17
OS: CentOS 6.5 | Database: Oracle 12.1
Reporting: Pentaho | DW Database: PostgreSQL
User database and auth module: LDAP (Active Directory)
Mail server: Microsoft Exchange | Sendmail module: Sendmail
3rd party packages: Yes | SSL: Yes
Number of agents: 450 | Number of customers: 20000 | Number of CIs: 30000

lido
OTRS expert
Posts: 70
Joined: 25 Oct 2017, 16:21
OTRS Version?: 6.0.5

Re: Wrong notificaton date format

Post by lido » 31 Jan 2018, 13:06

When searching OTRS's github for "%Y-%M-%D %T" it returns only one result and that's on the en_CA.pm file which I don't think is the actual issue.


Still, I did some further searching (using your example tag <OTRS_TICKET_SolutionTimeDestinationDate> as base) and found that the notification tags <OTRS_TICKET_*> are basically getting the parameters from the TicketGet method which in turn get's all it's escalation parameters from the TicketEscalationDateCalculation method.

That method uses the DateTime module to output its result string.

Finally, it's this DateTime::toString() method that's outputting the dates in the following format: '%Y-%m-%d %H:%M:%S' which I assume is exactly what you're getting.

So, in conclusion, I guess this is either a missing feature or maybe it's actually like this by design as (at least) that escalation parameter doesn't appear to be getting converted to any of the date formats available on the language files.

Disclaimer: I'm not connected with OTRS development in any way. I just did some code digging so it's possible that I missed something.

Maybe post on bugs.otrs.org to get some feedback from the developers.

Boa sorte ;)
Last edited by lido on 31 Jan 2018, 17:10, edited 1 time in total.

User avatar
nedmaj
OTRS wizard
Posts: 155
Joined: 26 Nov 2014, 20:34
OTRS Version?: 5.0.17
Real Name: Samuel Casimiro
Company: CD
Contact:

Re: Wrong notificaton date format

Post by nedmaj » 31 Jan 2018, 14:10

Thanks lido, I think you're right!

Reported a bug at bug.otrs.org:

https://bugs.otrs.org/show_bug.cgi?id=13602

Inté!
Samuel

OTRS 5.0.17 | OTRS::ITSM 5.0.17
OS: CentOS 6.5 | Database: Oracle 12.1
Reporting: Pentaho | DW Database: PostgreSQL
User database and auth module: LDAP (Active Directory)
Mail server: Microsoft Exchange | Sendmail module: Sendmail
3rd party packages: Yes | SSL: Yes
Number of agents: 450 | Number of customers: 20000 | Number of CIs: 30000

User avatar
nedmaj
OTRS wizard
Posts: 155
Joined: 26 Nov 2014, 20:34
OTRS Version?: 5.0.17
Real Name: Samuel Casimiro
Company: CD
Contact:

Re: Wrong notificaton date format

Post by nedmaj » 05 Feb 2018, 19:26

Upgraded to 5.0.26 and looks like the problem was solved.

Thanks!
Samuel

OTRS 5.0.17 | OTRS::ITSM 5.0.17
OS: CentOS 6.5 | Database: Oracle 12.1
Reporting: Pentaho | DW Database: PostgreSQL
User database and auth module: LDAP (Active Directory)
Mail server: Microsoft Exchange | Sendmail module: Sendmail
3rd party packages: Yes | SSL: Yes
Number of agents: 450 | Number of customers: 20000 | Number of CIs: 30000

Post Reply