[rt-users] Requiring CF to be defined on resolve

Emmanuel Lacour elacour at easter-eggs.com
Mon Aug 23 09:04:50 EDT 2010

On Sat, Aug 21, 2010 at 10:35:24PM -0500, Francis L Fabrizio wrote:
> I want to check that a certain custom field is defined when a user tries to resolve a ticket.  If it is not defined, I don't want to allow the resolve to proceed, and I want to show a status message to the user letting them know that the resolve failed because they need to provide a value for this custom field.
> I can detect whether the CF has a value, but I can't figure out how to prevent the resolve or display a message to the user in the Results area.  I did figure out that I could just set status back to open in my scrip action, but unfortunately the Results area still reads "Status set from open to resolved" even though the ticket is still open, because the initiating transaction was open -> resolved.  I cannot figure out how to write into that Results area at all to let the user know the resolve did not work.
> Is there any way to abort the attempted resolve transaction if the CF is undefined and leave a message for the user saying why?

In Ticket/Update.html, you should look at code that call
/Elements/ValidateCustomFields and do something like this. (i.e. set
check_failure=1; and add you're message to @results (which will be
displayed to user using /Elements/ListActions like every
information/error messages in RT)).

More information about the rt-users mailing list