<div dir="ltr">I got this working but I just created a user in the DB that only has rights to read the Subject & ID and worked from there.<div><br></div><div>Thanks.</div><div><br></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div><div>--<br>Kevin Holleran<br>Master of Science, Computer Information Systems<br>Grand Valley State University<br>Master of Business Administration<br>Western Michigan University<br><span style="font-size:small;font-family:arial">CISSP, GISP, </span><span style="font-size:small;font-family:arial">GXPN, GCFA, </span>GCFE, PCIP, PCI ISA, Cisco CCNA, ICCP ISA, Microsoft MCSA<br><div><br></div><div>"If you have responsibility for security, but no authority to make changes, then you're just there to take the blame when something goes wrong" Gene Spafford - Spafford's First Law of Security </div><div><br></div><div>"Do today what others won't, do tomorrow what others can't" - SEALFit<div><br></div><div>"We are what we repeatedly do. Excellence, then, is not an act, but a habit." - Aristotle</div></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, Oct 3, 2014 at 1:38 PM, Kevin Holleran <span dir="ltr"><<a href="mailto:holleran.kevin@gmail.com" target="_blank">holleran.kevin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Sorry, hit the wrong button and sent early...
</div><div class="gmail_extra"><br></div><div class="gmail_extra"><span class=""><span style="font-family:arial,sans-serif;font-size:13px">Hello,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I want to write a custom script at OnCreate that sets the subject of the new Ticket.  </div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Our Subject format starts with:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">YYYY-MM-XXXX: [TEXT] where YY is the year, MM is the month, and XXXX is a incrementing number.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">So in pseudo code, I would like to say</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">(y,m,d) = getDate(Y-m-d).split('-')</div><div style="font-family:arial,sans-serif;font-size:13px">last_ticket_subj = last_created_ticket().split(':')[0]</div><div style="font-family:arial,sans-serif;font-size:13px">(ly,lm,lx) = split('-')</div><div style="font-family:arial,sans-serif;font-size:13px">if (y==ly AND m==lm):</div></span><div style="font-family:arial,sans-serif;font-size:13px">    newx = (int)lx + 1</div><div style="font-family:arial,sans-serif;font-size:13px">    self->Ticket->subject = "y-m-newx:"</div><span class=""><div style="font-family:arial,sans-serif;font-size:13px">else</div><div style="font-family:arial,sans-serif;font-size:13px">    self->Ticket->subject = "y-m-0001:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></span><div style="font-family:arial,sans-serif;font-size:13px">I know that this is not functional code but I think it gets the point across.  How do I get the last ticket subject out of RT and how do I set the new tickets subject?</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks for your help and sorry for the two emails.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></div></div>
</blockquote></div><br></div></div>