Reassigning ticket to other queue from a queue depending upon the custom field value

I’d put that logging in as the second line in the commit code, so that you can see the value whichever way it goes.

Don’t worry about transaction batching for the moment, lets just see if the logic is working right.

The value will be shown in RT log while creating ticket right?

I would set the logging to error as well to ensure your logging levels will pick up the logging.

hi i got the below error in log.

Scrip 1731 Commit failed: Global symbol “$ticket” requires explicit package name at (eval 436) line 2.
Global symbol “$ticket” requires explicit package name at (eval 436) line 3.

Thanks team. I got it fixed. I have added $self->ticketobj->FirstCustomFieldValue($cf) and it worked.

1)Could anyone please let me know what the $self and ticketobj does here?
2)How can I get to know all the RT object and function’s functionality. Ineed to implement lots of scrips now. Kindly let me know how can I get all the details.

I believe Knation has already pointed out the best practical documentation RT 4.4.4 Documentation - Best Practical and GreenJimll has noted the wiki documentation. These are probably the best place to start

Yeah. Thank you. I am currently going through it.

Or as Green Jim said you can look through the source code to get a good idea how the RT ticket object works: lib/RT/Ticket.pm and lib/RT/Record.pm

I have successfully reassigned the ticket to other queue depending upon custom field values but the message on the top still shows like “Ticket xxxx created in the first queue”. I need to set the message that it is created in the second queue. Can anyone suggest how to set the message value.

I don’t think there is an easy method for doing this, it is possible by writing some code using callbacks but it is not totally straight forward.

If this scrip is running On Create is it not possible to have the person creating the ticket and selecting additional hardware required to change the queue manually since they should know if it should be in this other queue at create time?

Another option is to have some JavaScript that looks for this very specific case and changes the ‘Queue’ value from the ticket create form if the additional hardware required is set to yes.

Yeah… Thank you. I will check it.