We have a requirement of auto generation of reference number depending upon fields that are selected by reporter while creating the ticket . The reference number should be generated when ticket is created or when the ticket is transition from status A to status B.
If the reporter select "Motor" from custom field Department while creating the ticket the reference number should be Motor_23_05 where Motor is selected by reporter from Department cf field, 23 is last two digit of year in which the ticket is raised and 05 is the 5th ticket under motor which is selected under department CF.
i.e., user has select department as “Motor” for the 5th time i.e., he has raised 4 tickets before by selecting the department as “Motor” and now its 5th time he is raising ticket by selecting "Motor" as department and the unique reference number we must get as “Motor_23_05”.
Reference number needs to be populated in new custom field.(for e.g. cf unique reference no.)