No subject


Thu Oct 13 11:38:50 EDT 2022


Any ideas?
Rafael

PS: In your code, the user that re-open the ticket is the user that send
the correspondance isn't it?. Am I wrong saying that this user could not
the right to do so? (that's why the current code to the change using the
RT_System user?)


-----Original Message-----
From: Jesse Vincent [mailto:jesse at bestpractical.com]=20
Sent: vendredi, 11. janvier 2002 20:16
To: Bruce Campbell
Cc: RT Users
Subject: Re: [rt-users] RT_System opening tickets?


Without running that code, yeah, it looks like it would work.

On Fri, Jan 11, 2002 at 07:24:20PM +0100, Bruce Campbell wrote:
> On Fri, 11 Jan 2002, Jesse Vincent wrote:
>=20
> > RT automatically opens tickets when you start doing things like=20
> > adding new updates to them. (And yes, in the distant future, this=20
> > should all be done with Scrips, rather than hard-coded)
>=20
> OnCorrespond ReOpenTicket with template Blank ?
>=20
> Hrm, would the following work (as RT::Action::ReOpenTicket) ?
>=20
> ( brief sideline in trying to stop from going mad on other matters )
>=20
> --=20
>                              Bruce Campbell
RIPE
>
NCC
>                                                                 =20
> Operations
>=20
> 	# Copyright guff - 2002  Bruce Campbell
(bruce_campbell at ripe.net)
> 	package RT::Action::ReOpenTicket;
> 	require RT::Action::Generic;
>=20
> 	@ISA =3D qw(RT::Action::Generic);
>=20
> 	=3Dhead1 NAME
>=20
> 	RT::Action::ReOpenTicket - An Action to re-open a ticket if two
> 	conditions are met - correspondence has come in, and the ticket
> 	is marked as resolved.
>=20
> 	=3Dhead1 SYNOPSIS
>=20
> 	require RT::Action::ReOpenTicket;
> 	@ISA =3D qw(RT::Action::ReOpenTicket);
>=20
> 	=3Dhead1 DESCRIPTION
>=20
> 	This only affects tickets which are resolved.  Tickets with any
> 	other status stay that way.
>=20
> 	Does not send email when this happens.  In Scrip terms, this is:
>=20
> 		OnCorrespond ReOpenTicket with template Blank
>=20
> 	=3Dbegin testing
>=20
> 	ok (require RT::TestHarness);
> 	ok (require RT::Action::Generic);
>=20
> 	=3Dend testing
>=20
> 	=3Dhead1 AUTHOR
>=20
> 	Bruce Campbell <bruce_campbell at ripe.net>
>=20
> 	=3Dhead1 SEE ALSO
>=20
> 	perl(1), RT
>=20
> 	=3Dcut
>=20
> 	# Prepare ourselves.  Check if this ticket is resolved.
> 	sub Prepare {
> 		my $self =3D shift;
>=20
> 		my $retval =3D 0;
> 		if( $self->TicketObj ){
> 			if( $self->TicketObj->Status =3D~ /resolve/i ){
> 				$retval =3D 1;
> 			}
> 		}else{
> 			$RT::Logger->warning("No ticket object handed to
$self\n");
> 		}
> 		return( $retval );
> 	}
>=20
> 	# Open the ticket.
> 	sub Commit {
>=20
> 		my $self =3D shift;
> 		my $retval =3D 0;
> 		if( $self->TicketObj ){
> 			# Let this module be reused if we want to do
something
> 			# else with it.
> 			my $action =3D $self->Argument || "open";
>=20
> 			# SetStatus takes care of current user etc.
> 			$retval =3D $self->TicketObj->SetStatus( $action
);
> 		}else{
> 			$RT::Logger->warning("No ticket object handed to
$self\n");
> 		}
> 		return( $retval );
> 	}
>=20
>=20
>=20

--=20
http://www.bestpractical.com/products/rt  -- Trouble Ticketing. Free.

_______________________________________________
rt-users mailing list
rt-users at lists.fsck.com http://lists.fsck.com/mailman/listinfo/rt-users




More information about the rt-users mailing list