Approvals status open->resolved

Hi all,

I’m using RT 3.8.2 to set up approvals, and I’d like the approval process to
set the ticket status to “resolved”, instead of “open”. I’m setting the
status to “pending” inbetween times, and I’d like to get to “resolved”
without RT ignoring me :slight_smile: To which end I have fudged the code temporarily
like this:

/opt/rt3/lib/RT/Approval/Rule/Passed.pm:line 80:

    # $obj->SetStatus( Status => 'open', Force => 1 );
    $obj->SetStatus( Status => 'resolved', Force => 1 );

Only the ticket is still set to “open”!

The target ticket is happily marked as “rejected” or “open”, but I’m unable to
get it to choose “resolved”… I’ve also tried this with local/ with no more
luck - anyone have a better idea, please?

Richard Foley
Ciao - shorter than aufwiedersehen

Richard Foley <Richard.Foley rfi.net> writes:

Hi all,

I’m using RT 3.8.2 to set up approvals, and I’d like the approval process to
set the ticket status to “resolved”, instead of “open”. I’m setting the
status to “pending” inbetween times, and I’d like to get to “resolved”
without RT ignoring me To which end I have fudged the code temporarily
like this:

Do you mean the status of the ticket pending approval? the code you changed is
for setting the status for the approvals of next level to “open”. If you want
to change the status of the “top” ticket, you want to do that in the “if
($passed)” section, and do SetStatus on $top.

Hi Chia-liang,

Ok, so now I’ve got this:

if ($passed) {
    $top->SetStatus( Status => 'resolved', Force => 1 );
    $self->RunScripAction('Notify Owner', 'Approval Ready for Owner',
                          TicketObj => $top);
}

and nothing happens…

?-\

What I have is:

  1. The original ticket status changed from “new” to “pending” via a Scrip.

  2. The generated approval ticket has an automatic status of “open”.

  3. When I “Approve” the approval ticket, (which sets itself to “resolved”),

  4. I want the original ticket to get a status of “resolved” also, but it does
    nothing currently.

Richard Foley
Ciao - shorter than aufwiedersehen

Richard Foley <Richard.Foley rfi.net> writes:

Hi all,

I’m using RT 3.8.2 to set up approvals, and I’d like the approval process
to
set the ticket status to “resolved”, instead of “open”. I’m setting the
status to “pending” inbetween times, and I’d like to get to “resolved”
without RT ignoring me To which end I have fudged the code temporarily
like this:

Do you mean the status of the ticket pending approval? the code you changed
is
for setting the status for the approvals of next level to “open”. If you
want
to change the status of the “top” ticket, you want to do that in the “if
($passed)” section, and do SetStatus on $top.

/opt/rt3/lib/RT/Approval/Rule/Passed.pm:line 80:

    # $obj->SetStatus( Status => 'open', Force => 1 );
    $obj->SetStatus( Status => 'resolved', Force => 1 );

Only the ticket is still set to “open”!

The target ticket is happily marked as “rejected” or “open”, but I’m
unable to
get it to choose “resolved”… I’ve also tried this with local/ with no
more

Richard,

Richard Foley <Richard.Foley rfi.net> writes:

Hi Chia-liang,

Ok, so now I’ve got this:

if ($passed) {
    $top->SetStatus( Status => 'resolved', Force => 1 );
    $self->RunScripAction('Notify Owner', 'Approval Ready for Owner',
                          TicketObj => $top);
}

the change seems to work for me. Here’s the change to the test in
t/approval/basic.t that demostrates the original ticket got set to resolved upon
all approval passed:

http://fsck.com/~clkao/rt-approval-autoresolve.patch

Hi Chia-liang,

Ok, thanks for the reply and the patch to prove your point, even though this
doesn’t work for me. I believe that the internal approval system is assuming
certain things about the tickets its handling, such as that the approval will
be created along with the initial ticket, instead of possibly on an arbitrary
status change, thus the initial state of the original ticket will not be “new”
at all, but possibly “pending”, or “resolved”, or whatever. As soon as the
expected sequence of statuses is disturbed, the approval flow appears to fail
to work as expected. I think this is going to catch a lot of people out.

Perhaps RTx-WorkflowBuilder will be a more generic solution?

Richard Foley
Ciao - shorter than aufwiedersehen

One, Two, Free! – Richard Foley Saturday 14 February 2009 02:22:46 Chia-liang Kao wrote:

Richard,

Richard Foley <Richard.Foley rfi.net> writes:

Hi Chia-liang,

Ok, so now I’ve got this:

if ($passed) {
    $top->SetStatus( Status => 'resolved', Force => 1 );
    $self->RunScripAction('Notify Owner', 'Approval Ready for Owner',
                          TicketObj => $top);
}

the change seems to work for me. Here’s the change to the test in
t/approval/basic.t that demostrates the original ticket got set to resolved
upon all approval passed:

http://fsck.com/~clkao/rt-approval-autoresolve.patch


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Richard Foley
Ciao - shorter than aufwiedersehen