[Rt-commit] rt branch, 5.0/create-tickets-skip-flag, created. rt-5.0.1-1-g70fac0ddd4

Craig Kaiser craig at bestpractical.com
Wed Jun 2 10:14:06 EDT 2021


The branch, 5.0/create-tickets-skip-flag has been created
        at  70fac0ddd4aac106f0b1dcb83e210633f3f675bb (commit)

- Log -----------------------------------------------------------------
commit 70fac0ddd4aac106f0b1dcb83e210633f3f675bb
Author: craig kaiser <craig at bestpractical.com>
Date:   Wed Jun 2 09:36:40 2021 -0400

    Allow skipping of create ticket blocks through passing arg
    
    This allows for logic to be placed inside of the '===' create ticket
    blocks to decide if a ticket should be created or not.

diff --git a/lib/RT/Action/CreateTickets.pm b/lib/RT/Action/CreateTickets.pm
index af3d9d0779..894e81b5e8 100644
--- a/lib/RT/Action/CreateTickets.pm
+++ b/lib/RT/Action/CreateTickets.pm
@@ -223,6 +223,8 @@ A complete list of acceptable fields:
        CF-name           => custom field value
        CustomField-name  => custom field value
 
+       Skip              => 1 - Boolean flag to decide to skip this create ticket block.
+
 Fields marked with an C<*> are required.
 
 Fields marked with a C<+> may have multiple values, simply
@@ -325,6 +327,11 @@ sub CreateByTemplate {
         # Make sure we have at least the minimum set of
         # reasonable data and do our thang
 
+        if ( $ticketargs->{'Skip'} ) {
+            RT::Logger->debug( "Skip flag found for template $template_id, skipping" );
+            next;
+        }
+
         my ( $id, $transid, $msg )
             = $T::Tickets{$template_id}->Create(%$ticketargs);
 
@@ -733,6 +740,7 @@ sub ParseLines {
         FinalPriority   => $args{'finalpriority'} || 0,
         SquelchMailTo   => $args{'squelchmailto'},
         Type            => $args{'type'},
+        Skip            => $args{'skip'},
     );
 
     if ( $args{content} ) {

-----------------------------------------------------------------------


More information about the rt-commit mailing list