I believe you could manually alter the value in the key_value_store database table. Not 100% sure though, definitely make sure you don't start with a lower ID number than what was set as this may result in duplicate IDs!
Last edit: Jeffrey Bostoen 2023-01-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Indeed to have an incremental counter per year you'll have to change the way the counter is incremented. In the default datamodel (considering the reference values you gave, you already made some modifications) it is done in Ticket::DBInsertNoReload. The easiest way to do would be to pass the class + the year to \ItopCounter::IncClass
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The easiest way to do would be to pass the class + the year to \ItopCounter::IncClass
Sorry I answered too quickly
Looking at the code the class is indeed used in the callback set in \ItopCounter::IncClass
So you'll have to write your own implementation, maybe a children of ItopCounter and just an override of \ItopCounter::IncClass ?
Last edit: Pierre Goiffon 2023-09-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have used iTop 3.0
I have a custom ticket number as INC2022000001 or CHG2022000002 Then I want to change the year 2023 and reset the ticket number to INC2023000001.
I'm trying to find information in this discussion.
https://sourceforge.net/p/itop/discussion/customizing-itop/thread/4e074a9a/?limit=25#c5dc/c126/24fc
Does anyone know how to reset ItopCounter?
or does anyone else have a better way? Please advise us.
Thank you.
I believe you could manually alter the value in the key_value_store database table. Not 100% sure though, definitely make sure you don't start with a lower ID number than what was set as this may result in duplicate IDs!
Last edit: Jeffrey Bostoen 2023-01-06
Hello,
Indeed to have an incremental counter per year you'll have to change the way the counter is incremented. In the default datamodel (considering the reference values you gave, you already made some modifications) it is done in Ticket::DBInsertNoReload. The easiest way to do would be to pass the class + the year to \ItopCounter::IncClass
Sorry I answered too quickly
Looking at the code the class is indeed used in the callback set in \ItopCounter::IncClass
So you'll have to write your own implementation, maybe a children of ItopCounter and just an override of \ItopCounter::IncClass ?
Last edit: Pierre Goiffon 2023-09-04