[Rt-devel] configurable option for fields to use when cloning a ticket
Jesse Vincent
jesse at bestpractical.com
Thu Jan 22 12:15:30 EST 2009
On Wed, Jan 21, 2009 at 01:17:52PM -0600, Roedel, Mark wrote:
> OK...a first attempt is attached. This patch against the 3.8.2 release
> adds a @TicketCloneFields setting to RT_Config.pm (and RT_Config.pm.in)
> and modifies Ticket/Create.html to use that value instead of the
> hard-coded list of fields when executing a clone.
Looks basically ok to me. I've asked one of my folks to do a code
review. Any brave users feel like trying this out to see how well it
works for them?
>
> --
> Mark Roedel
> Senior Programmer/Analyst - Web Services
> LeTourneau University
>
>
> -----Original Message-----
> From: Jesse Vincent [mailto:jesse at bestpractical.com]
> Sent: Wednesday, January 21, 2009 10:07 AM
> To: Roedel, Mark
> Cc: rt-devel at lists.bestpractical.com
> Subject: Re: [Rt-devel] configurable option for fields to use when
> cloning a ticket
>
>
>
>
> On Wed, Jan 21, 2009 at 10:05:34AM -0600, Roedel, Mark wrote:
> > A few of our users have noted that by default when a
> > dependent/parent/child ticket is created using the "Create" link in
> the
> > "Links" section of a ticket, the new ticket inherits among others the
> > TimeEstimated and TimeWorked fields from the existing ticket. If your
> > manager pays attention to your time spent requests, this can skew the
> > numbers!
> >
> > The list of fields copied into a new ticket appears to be specified in
> > line 267 of Ticket/Create.html. Rather than just maintaining our own
> > customized list of fields in a local Create.html, I'm wondering what
> > everyone would think of making that a configurable option in the
> central
> > RT config files?
>
>
> I'd love to review a patch for that.
Content-Description: rt382-patch-letu20090121-1.txt
> diff --recursive --unified rt-3.8.2/etc/RT_Config.pm rt-3.8.2-patched/etc/RT_Config.pm
> --- rt-3.8.2/etc/RT_Config.pm Wed Jan 7 09:16:38 2009
> +++ rt-3.8.2-patched/etc/RT_Config.pm Wed Jan 21 11:45:05 2009
> @@ -1186,6 +1186,20 @@
>
> =back
>
> +=item C<@TicketCloneFields>
> +
> +Use this to define the values that will be inherited by a ticket created using
> +any of the "Create" links that appear in a ticket's "Links" section. Fields
> +can include any of the values from the Ticket object. Default list is Owner,
> +Subject, FinalPriority, TimeEstimated, TimeWorked, Status, TimeLeft, Starts,
> +Started, Due and Resolved.
> +
> +=cut
> +
> +Set (@TicketCloneFields, (qw(Owner Subject FinalPriority TimeEstimated TimeWorked Status TimeLeft Starts Started Due Resolved)));
> +
> += back
> +
> =head1 L<Net::Server> (rt-server) Configuration
>
> =over 4
> diff --recursive --unified rt-3.8.2/etc/RT_Config.pm.in rt-3.8.2-patched/etc/RT_Config.pm.in
> --- rt-3.8.2/etc/RT_Config.pm.in Tue Jan 6 19:15:35 2009
> +++ rt-3.8.2-patched/etc/RT_Config.pm.in Wed Jan 21 11:43:39 2009
> @@ -1186,6 +1186,20 @@
>
> =back
>
> +=item C<@TicketCloneFields>
> +
> +Use this to define the values that will be inherited by a ticket created using
> +any of the "Create" links that appear in a ticket's "Links" section. Fields
> +can include any of the values from the Ticket object. Default list is Owner,
> +Subject, FinalPriority, TimeEstimated, TimeWorked, Status, TimeLeft, Starts,
> +Started, Due and Resolved.
> +
> +=cut
> +
> +Set (@TicketCloneFields, (qw(Owner Subject FinalPriority TimeEstimated TimeWorked Status TimeLeft Starts Started Due Resolved)));
> +
> += back
> +
> =head1 L<Net::Server> (rt-server) Configuration
>
> =over 4
> diff --recursive --unified rt-3.8.2/share/html/Ticket/Create.html rt-3.8.2-patched/share/html/Ticket/Create.html
> --- rt-3.8.2/share/html/Ticket/Create.html Tue Jan 6 19:15:22 2009
> +++ rt-3.8.2-patched/share/html/Ticket/Create.html Wed Jan 21 10:30:00 2009
> @@ -263,9 +263,7 @@
> InitialPriority => $CloneTicketObj->Priority,
> };
>
> - $clone->{$_} = $CloneTicketObj->$_()
> - for qw/Owner Subject FinalPriority TimeEstimated TimeWorked
> - Status TimeLeft Starts Started Due Resolved/;
> + $clone->{$_} = $CloneTicketObj->$_() for RT->Config->Get('TicketCloneFields', $session{'CurrentUser'});
>
> my $members = $CloneTicketObj->Members;
> my ( @members, @members_of, @refers, @refers_by, @depends, @depends_by );
--
More information about the Rt-devel
mailing list