A little help with a 4.x callback?

I see in 4.2.x (perhaps in 4.0.x) that there is now a ProcessUpdates
callback available for use in Ticket/Modify.html

I’m reworking some old 3.8 code that would send a message to the end
user via (sigh) … Abort() … if a certain field had not been set
to a value and the user was trying to resolve the ticket.

The Ticket/Modify.html callback call reads as:

$m->callback( CallbackName => 'ProcessUpdates', TicketObj =>

$TicketObj, ARGSRef => %ARGS, Results => @results );

How might I make use of this @results array in my callback?

What should my <%ARGS> section look like?

I looked around, but the wiki is a little lacking in info about
how to construct the <%ARGS> section in the callback file, etc,
for those not fluent in Perl past the basics (let alone Mason).

I see in 4.2.x (perhaps in 4.0.x) that there is now a ProcessUpdates
callback available for use in Ticket/Modify.html

I’m reworking some old 3.8 code that would send a message to the end
user via (sigh) … Abort() … if a certain field had not been set
to a value and the user was trying to resolve the ticket.

The Ticket/Modify.html callback call reads as:

$m->callback( CallbackName => 'ProcessUpdates', TicketObj =>

$TicketObj, ARGSRef => %ARGS, Results => @results );

How might I make use of this @results array in my callback?

If you’re trying to block the update, ProcessUpdates is too late (all
it lets you do is make more changes and push messages back up to the
user).

If you want to actively block the user, look at
RT-Extension-MandatoryOnTransition. It uses the BeforeUpdate callback
in Ticket/Update.html to set skip_create and push onto @results. You
can clone that functionality to the Default callback in
Ticket/Modify.html.

-kevin

1 Like

I see in 4.2.x (perhaps in 4.0.x) that there is now a ProcessUpdates
callback available for use in Ticket/Modify.html

I’m reworking some old 3.8 code that would send a message to the end
user via (sigh) … Abort() … if a certain field had not been set
to a value and the user was trying to resolve the ticket.

The Ticket/Modify.html callback call reads as:

$m->callback( CallbackName => 'ProcessUpdates', TicketObj =>

$TicketObj, ARGSRef => %ARGS, Results => @results );

How might I make use of this @results array in my callback?

If you’re trying to block the update, ProcessUpdates is too late (all
it lets you do is make more changes and push messages back up to the
user).

Yes, I finally got to that same understanding in the last few
hours working on this some more. I’m using ‘Default’ now.

If you want to actively block the user, look at
RT-Extension-MandatoryOnTransition. It uses the BeforeUpdate callback

Oh, excellent. This will allow us to offload quite a bit of the
logic we already have in place and instead focus on the “real”
custom logic we need.

in Ticket/Update.html to set skip_create and push onto @results. You
can clone that functionality to the Default callback in
Ticket/Modify.html.

Thanks Kevin.