[rt-users] A serial custom field... sort of

Kenneth Crocker KFCrocker at lbl.gov
Mon Sep 22 13:20:06 EDT 2008


Ernesto,


	What you are talking about is a Queue-specific reference number. Not 
hard to do. For every queue that needs this, define the CF with an 
appropriate name for a specific Queue (I believe in 3.8.1 you can define 
Queue-level CF's that do NOT have to be on a ticket. Maybe a name like 
"Queue Reference Number" would work). Then, you define a CF to be used 
for All tickets in that Queue (like "Ticket Reference Number"). You then 
write a Queue-level script that examines a transaction and if the type 
is a create, and it is for one of the Queues that needs this CF, then 
pull the CF for THAT "Queue" and add 1 to it and then put that new 
number back in the "Queue-level" CF and also insert it into the new 
ticket in that queue. Hope this helps.


Kenn
LBNL

On 9/22/2008 7:14 AM, Ernesto Hernandez-Novich wrote:
> I've been requested something quite odd: a custom field that behaves
> like a SERIAL column on a database. The specific request was "a custom
> field that has no duplicates and it's _always_ kept in sequence".
> 
> Initially I suggested using the ticket number instead, but the user
> states that according to their "process" the numbering must be gapless.
> They don't mind, and would even appreciate, if the number gets generated
> automatically. I explained the fact that if there were two users
> creating a new ticket, the numbering would depend on "who hits submit
> first" and they're fine with that.
> 
> Any suggestions on how to approach this?




More information about the rt-users mailing list