Hi Guys,

I have found out, to customize the ticket number we need to modify the below mentioned function in class.misc.php:

function randNumber($len=6,$start=false,$end=false) {

mt_srand ((double) microtime() * 1000000);

$start=(!$len && $start)?$start(1,$len,"0",STR_PAD_RIGHT);

$end=(!$len && $end)?$end(9,$len,"9",STR_PAD_RIGHT);

return mt_rand($start,$end);

}

We also need to make some changes in class.ticket.php. I need to get a custom ticket in the format 20111206001, the first four digits are year, next two digits are month, the next two are day and the last three digits are the incrementing digits which increment every time a ticket opens. These three digits reset to 001 as the date changes.

Solved

Hi Guys,

I am able to customize the ticket number.

Thanks for all the support by everybody.

Vipin

Cool, would you mind sharing the code? Thanks.

Hey beeman,

can you tell me the requirement so that i can help you with the same?

8 years later

hey leovipin1,

I have the same problem with you regarding the format of the custom ticket number 201909230001, do you help me with my problem

I use osticket v1.12.2

Write a Reply...