Dynamic field - Integer ?

Moderator: crythias

Post Reply
tuxtom
Znuny expert
Posts: 173
Joined: 22 Sep 2016, 11:44
Znuny Version: 6.0.38
Real Name: Tux
Location: Germany
Contact:

Dynamic field - Integer ?

Post by tuxtom »

OTRS 6.0.38

Hi All,
is it possible to assign a number to a dynamic field, an integer value? Not a text field!
I would need a field for working hours to make later evaluations in a ticket.
Or does anyone have another idea?


Regards, Tom.
-----------------------
Debian
OTRS 6.0.38, ITSM 6
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Dynamic field - Integer ?

Post by reneeb »

You could try https://opar.perl-services.de/dist/Dyna ... eger-6.0.2 . If you need it for Znuny 6.1 or 6.2, please let me know (I had no time to port it yet)...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
root
Administrator
Posts: 3960
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Dynamic field - Integer ?

Post by root »

Hi,

You can also use regular expression to check if the input is an integer. Sth like ^\d+$ should do the trick.

- 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 ?
tuxtom
Znuny expert
Posts: 173
Joined: 22 Sep 2016, 11:44
Znuny Version: 6.0.38
Real Name: Tux
Location: Germany
Contact:

Re: Dynamic field - Integer ?

Post by tuxtom »

Hi All.
thanks.
I'll try it.

Regards, Tom.
-----------------------
Debian
OTRS 6.0.38, ITSM 6
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Dynamic field - Integer ?

Post by reneeb »

root wrote: 09 Mar 2022, 10:39 You can also use regular expression to check if the input is an integer. Sth like ^\d+$ should do the trick.
But sorting doesn't work correctly then. Text fields are sorted like 1, 11, 12, 2, 21, 3, 4, 5...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
root
Administrator
Posts: 3960
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Dynamic field - Integer ?

Post by root »

reneeb wrote: 09 Mar 2022, 13:22
root wrote: 09 Mar 2022, 10:39 You can also use regular expression to check if the input is an integer. Sth like ^\d+$ should do the trick.
But sorting doesn't work correctly then. Text fields are sorted like 1, 11, 12, 2, 21, 3, 4, 5...
Sure, maybe I did not see the part where a select field was mentioned ;-)
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 ?
tuxtom
Znuny expert
Posts: 173
Joined: 22 Sep 2016, 11:44
Znuny Version: 6.0.38
Real Name: Tux
Location: Germany
Contact:

Re: Dynamic field - Integer ?

Post by tuxtom »

Hi,
the plugin works well. I am trying some other things right now. Is it also possible to include the "TimeUnits" field in the "AgentTicketFreeText" template?
I see it only in close tickets.
I just don't want to change the tt-file.
TimeUnits can also do comma numbers and summed up the numbers automatically.
You can test this if you close the ticket more often and always change the time unit. ;-)
Regards, Tom.
-----------------------
Debian
OTRS 6.0.38, ITSM 6
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Dynamic field - Integer ?

Post by reneeb »

In the AgentTicketFreeText dialog you can only change ticket settings and TimeUnits is something for Articles. So no, you can't edit the TimeUnits.
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Post Reply