[rt-users] Assign Subject On Create

Kevin Holleran holleran.kevin at gmail.com
Fri Oct 3 13:36:27 EDT 2014


Hello,

I want to write a custom script at OnCreate that sets the subject of the
new Ticket.

Our Subject format starts with:

YYYY-MM-XXXX: [TEXT] where YY is the year, MM is the month, and XXXX is a
incrementing number.

So in pseudo code, I would like to say

(y,m,d) = getDate(Y-m-d).split('-')
last_ticket_subj = last_created_ticket().split(':')[0]
(ly,lm,lx) = split('-')
if (y==ly AND m==lm):

    self->Ticket->subject = "y-m-0001:"
else
    self->Ticket->subject = "y-m-0001:"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20141003/5faeef26/attachment.html>


More information about the rt-users mailing list