Modify a field when generating a url

Moderator: crythias

Post Reply
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Modify a field when generating a url

Post by PhyrePhoX »

Hi,

i create a link to an external system by using (for example) [% Data.Created | uri %]

This creates a date in format "yyyy-MM-dd HH:mm:ss". Now, in the external system there has been a change and they only accept "yyyy-MM-dd HH:mm" (without the seconds!).
Is there any way i can tell OTRS how to format the output of "Data.Created"? Or can i build an alternate way, for example by stacking "Day.Created" "month.created" "year.created" "hour.created" "minute.created"?

Thank you!
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
root
Administrator
Posts: 3968
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Modify a field when generating a url

Post by root »

Hi,

Without checking, I would try to use trunce (http://template-toolkit.org/docs/manual/Filters.html) from before URI.

Code: Select all

 [% Data.Created | truncate(16, '') |uri %]
- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Re: Modify a field when generating a url

Post by PhyrePhoX »

Perfect, thank you!
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
Post Reply