[Solved] Set Ticket Number Counter reset by year

Moderator: crythias

Locked
kelvinwuko
Znuny newbie
Posts: 12
Joined: 06 Feb 2020, 20:01
Znuny Version: OTRS 6
Real Name: Kelvin Wu

[Solved] Set Ticket Number Counter reset by year

Post by kelvinwuko »

Dear all,

I am trying to set my ticket number format to 2020/0001 where 2020 is the year and the 0001 increments by 1 when new ticket creates.
I know the ticket number is combination of date, SystemID and counter and my ticket number now is 2020/000X and the counter resets to 0001 every day by default.

How can I change TicketNumberGenerator to reset to 0001 by year instead of by day?
Thank you everyone for your time! Hope I can get some help here. :)

Best regards,
Kelvin
Last edited by kelvinwuko on 16 Mar 2020, 03:30, edited 1 time in total.
zzz
Znuny superhero
Posts: 914
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Set Ticket Number Counter reset by year

Post by zzz »

Hello Kelvin,

You can, unfortunately, not configure that. The only way would be to create an own module for ticket numbers.
Examples: https://github.com/OTRS/otrs/tree/rel-6 ... ket/Number

Best regards
Emin
Professional Znuny and OTRS services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
kelvinwuko
Znuny newbie
Posts: 12
Joined: 06 Feb 2020, 20:01
Znuny Version: OTRS 6
Real Name: Kelvin Wu

Re: Set Ticket Number Counter reset by year

Post by kelvinwuko »

Dear Emin,

Thank you for your reply, but should I re-code the $counter from the Date.pm or should I need to code my own $counter in a newly created .pm module and deploy it?

Thanks again for your time!

Best regards,
Kelvin
zzz
Znuny superhero
Posts: 914
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Set Ticket Number Counter reset by year

Post by zzz »

You can do both.
It's probably the best to create your own module and place it in that directory (you can use the code of Date.pm as a starting point, tho).
After doing so, you can select the new module in the system configuration 'Ticket::NumberGenerator'.

Best regards
Emin
Professional Znuny and OTRS services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
Locked