[Rt-commit] rtir branch 5.0-trunk updated. 5.0.3-13-g21e55d99

BPS Git Server git at git.bestpractical.com
Wed Apr 12 20:09:25 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rtir".

The branch, 5.0-trunk has been updated
       via  21e55d9930b6baaab9dee40663bf6b892cd76e76 (commit)
       via  898aacf7f4a504a7d0abb1dceb553adc24526c2f (commit)
       via  3bd9b4951aafdb4a0b6c1cf19851cfc9f6884c32 (commit)
       via  adc4ef8a6148aa39a56b7521731eeb187cebe11d (commit)
      from  a139245523190f0efeffd37e2afcc25d43003932 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 21e55d9930b6baaab9dee40663bf6b892cd76e76
Merge: a1392455 898aacf7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Apr 13 03:46:30 2023 +0800

    Merge branch '5.0/process-articles2' into 5.0-trunk


commit 898aacf7f4a504a7d0abb1dceb553adc24526c2f
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Wed Mar 29 17:09:04 2023 -0300

    Update RTIR Admin Tutorial with Process Articles information

diff --git a/docs/AdministrationTutorial.pod b/docs/AdministrationTutorial.pod
index f23e29da..d665835e 100644
--- a/docs/AdministrationTutorial.pod
+++ b/docs/AdministrationTutorial.pod
@@ -131,6 +131,38 @@ Customer for an IR or Investigation.
 
 =back
 
+=head2 Documenting Process for Incidents
+
+Starting in version 5.0.4, RT supports a feature called Process Articles
+that allows you to document the process for working on a ticket, and
+display it right on the page. The process is managed in an article,
+and which article to show is determined by a field on the ticket.
+
+Starting in RTIR 5.0.4 this feature is available for Incidents. The
+default Classification field contains values to indicate the type of
+the incident. You can set up an article for each of the Classification
+values to document how that type of incident should be handled. Once
+configured, this documentation will be shown right on the incident page.
+
+The configuration options L<ProcessArticleFields|https://docs.bestpractical.com/rt/latest/RT_Config.html#ProcessArticleFields>
+and L<ProcessArticleMapping|https://docs.bestpractical.com/rt/latest/RT_Config.html#ProcessArticleMapping>
+set the article class to use and also determine the mapping between
+the Classification values and corresponding articles. If you have
+added or removed Classification values, you can update this configuration
+with your new settings.
+
+Articles are created in a class called Incidents Processes by default,
+and members of the DutyTeam group can see and modify these articles. You can
+change the rights on the class if you want to restrict who can
+update the documentation.
+
+Edit the articles to add your actual process docuemtnation. Note that if
+you change the article Name field, you need to update the C<%ProcessArticleMapping>
+setting mentioned above because it uses the article name.
+
+This feature is optional and can be disabled by clearing the
+configuration options linked above.
+
 =head2 Managing "RT at a glance" and "RTIR at a glance" pages
 
 In the config you can set the C<@RTIR_HomepageComponents> option to control

commit 3bd9b4951aafdb4a0b6c1cf19851cfc9f6884c32
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Thu Mar 30 16:57:06 2023 -0300

    Update upgrading instructions with Process Articles information
    
    Process Articles content for RTIR will not be deployed by default
    on upgrades, so provide instructions for adding it manually.

diff --git a/docs/UPGRADING-5.0 b/docs/UPGRADING-5.0
index b7c43498..e06512f0 100644
--- a/docs/UPGRADING-5.0
+++ b/docs/UPGRADING-5.0
@@ -242,4 +242,23 @@ moving the scrip to Batch mode may restore the previous behavior.
 
 =back
 
+=head1 UPGRADING FROM 5.0.3 AND EARLIER
+
+=over 4
+
+=item * Processes Articles for Incidents
+
+Starting with RTIR 5.0.4, we include a new portlet on the Incident page
+which can show the process to be followed for an Incident based on the
+selected Classification.
+
+Default articles for the process documentation are installed in new RTIRs
+by default. For an existing RTIR system, you can also add the starter
+articles by running the following after your upgrade:
+
+    cd /opt/rt5
+    sbin/rt-setup-database --action insert --datafile local/plugins/RT-IR/etc/upgrade/process_articles_initialdata
+
+=back
+
 =cut
diff --git a/etc/upgrade/process_articles_initialdata b/etc/upgrade/process_articles_initialdata
index 56c46f82..7c51b657 100644
--- a/etc/upgrade/process_articles_initialdata
+++ b/etc/upgrade/process_articles_initialdata
@@ -81,9 +81,9 @@
         RT->Logger->error("Unable to load class Incidents Processes: $msg") unless $ok;
 
         my $content = RT::CustomField->new( RT->SystemUser );
-        $content->Load('Content');
+        $content->LoadByName(Name => 'Content', LookupType => RT::Article->CustomFieldLookupType);
 
-        my @skips = ( "Name", "Summary", "LinkToTicket", "CF-Title-" . $content->Id );
+        my @skips = ( "Name", "Summary", "LinkToTicket", $content->Id ? "CF-Title-" . $content->Id : () );
         $class->SetAttribute(Name => "Skip-$_", Content => 1) for @skips;
 
         my $group = RT::Group->new( RT->SystemUser );

commit adc4ef8a6148aa39a56b7521731eeb187cebe11d
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Wed Mar 29 17:06:48 2023 -0300

    Add Process Articles for Classification
    
    Default article data is installed for new RTIR installations.
    Separate initialdata is provided for existing systems for
    optional installation.

diff --git a/etc/RTIR_Config.pm b/etc/RTIR_Config.pm
index 8d836ef0..be018fe0 100644
--- a/etc/RTIR_Config.pm
+++ b/etc/RTIR_Config.pm
@@ -640,6 +640,34 @@ By default RTIR enables 'httpurl_overwrite', 'ip', 'email' and 'domain'.
 
 Set(@Active_MakeClicky, qw(httpurl_overwrite ip email domain));
 
+=item Process Articles for Incidents
+
+RTIR provides configuration to show process documentation on Incident
+pages based on the selected Classification. You can change this behavior
+via configuration using the options L<ProcessArticleFields|https://docs.bestpractical.com/rt/latest/RT_Config.html#ProcessArticleFields>
+and L<ProcessArticleMapping|https://docs.bestpractical.com/rt/latest/RT_Config.html#ProcessArticleMapping>.
+
+You can see additional information about how to manage Process Articles in
+the RT L<Articles|https://docs.bestpractical.com/rt/latest/customizing/articles_introduction.html>
+documentation.
+
+=cut
+
+Set( %ProcessArticleFields, (
+    Incidents => { Field => 'CF.Classification', Class => 'Incidents Processes' },
+));
+
+Set(%ProcessArticleMapping, (
+   'CF.Classification' => {
+        'Spam'              => 'Spam Process',
+        'System Compromise' => 'System Compromise Process',
+        'Query'             => 'Query Process',
+        'Scan'              => 'Scan Process',
+        'Denial of Service' => 'Denial of Service Process',
+        'Piracy'            => 'Piracy Process',
+    },
+));
+
 =back
 
 =head1 Custom Fields
diff --git a/etc/initialdata b/etc/initialdata
index 1b720a2d..280f4bc7 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -669,6 +669,82 @@ for my $cf (@CustomFields) {
         );
 }
 
+ at Classes = (
+    {
+        Name => 'Incidents Processes',
+        Description => 'Processes to be followed in the event of an incident',
+    }
+);
+
+ at Articles = (
+    {
+        Name => 'Spam Process',
+        Summary => 'This is the summary of the process for handling spam',
+        CustomFields => [
+            {
+                CustomField  => 'Content',
+                Content => 'This is the content of the process for handling spam',
+            },
+        ],
+        Class => 'Incidents Processes',
+    },
+    {
+        Name => 'System Compromise Process',
+        Summary => 'This is the summary of the process for handling system compromise',
+        CustomFields => [
+            {
+                CustomField  => 'Content',
+                Content => 'This is the content of the process for handling system compromise',
+            },
+        ],
+        Class => 'Incidents Processes',
+    },
+    {
+        Name => 'Query Process',
+        Summary => 'This is the summary of the process for handling queries',
+        CustomFields => [
+            {
+                CustomField  => 'Content',
+                Content => 'This is the content of the process for handling queries',
+            },
+        ],
+        Class => 'Incidents Processes',
+    },
+    {
+        Name => 'Scan Process',
+        Summary => 'This is the summary of the process for handling scans',
+        CustomFields => [
+            {
+                CustomField  => 'Content',
+                Content => 'This is the content of the process for handling scans',
+            },
+        ],
+        Class => 'Incidents Processes',
+    },
+    {
+        Name => 'Denial of Service Process',
+        Summary => 'This is the summary of the process for handling denial of service',
+        CustomFields => [
+            {
+                CustomField  => 'Content',
+                Content => 'This is the content of the process for handling denial of service',
+            },
+        ],
+        Class => 'Incidents Processes',
+    },
+    {
+        Name => 'Piracy Process',
+        Summary => 'This is the summary of the process for handling piracy',
+        CustomFields => [
+            {
+                CustomField  => 'Content',
+                Content => 'This is the content of the process for handling piracy',
+            },
+        ],
+        Class => 'Incidents Processes',
+    }
+);
+
 @Final = (
     sub {
         $| = 1;
@@ -817,5 +893,21 @@ for my $cf (@CustomFields) {
             RT->Logger->error("Couldn't create dashboard RTIR Homepage: $msg");
         }
     },
-);
+    sub {
+        my $class = RT::Class->new( RT->SystemUser );
+        my ($ok, $msg) = $class->Load('Incidents Processes');
+        RT->Logger->error("Unable to load class Incidents Processes: $msg") unless $ok;
+
+        my $content = RT::CustomField->new( RT->SystemUser );
+        $content->LoadByName( Name => 'Content', LookupType => RT::Article->CustomFieldLookupType );
+
+        my @skips = ( "Name", "Summary", "LinkToTicket", $content->Id ? "CF-Title-" . $content->Id : () );
+        $class->SetAttribute(Name => "Skip-$_", Content => 1) for @skips;
 
+        my $group = RT::Group->new( RT->SystemUser );
+        $group->LoadUserDefinedGroup("DutyTeam");
+        die "Can't load group" unless $group->Id;
+        $group->PrincipalObj->GrantRight( Right => $_, Object => $class )
+            for qw/ShowArticle SeeCustomField AdminClass AdminTopics CreateArticle ModifyArticle ModifyArticleTopics SeeClass ShowArticleHistory DeleteArticle/;
+        }
+);
diff --git a/etc/upgrade/process_articles_initialdata b/etc/upgrade/process_articles_initialdata
new file mode 100644
index 00000000..56c46f82
--- /dev/null
+++ b/etc/upgrade/process_articles_initialdata
@@ -0,0 +1,97 @@
+ at Classes = (
+    {
+        Name => 'Incidents Processes',
+        Description => 'Processes to be followed in the event of an incident',
+    }
+);
+
+ at Articles = (
+    {
+        Name => 'Spam Process',
+        Summary => 'This is the summary of the process for handling spam',
+        CustomFields => [
+            {
+                CustomField  => 'Content',
+                Content => 'This is the content of the process for handling spam',
+            },
+        ],
+        Class => 'Incidents Processes',
+    },
+    {
+        Name => 'System Compromise Process',
+        Summary => 'This is the summary of the process for handling system compromise',
+        CustomFields => [
+            {
+                CustomField  => 'Content',
+                Content => 'This is the content of the process for handling system compromise',
+            },
+        ],
+        Class => 'Incidents Processes',
+    },
+    {
+        Name => 'Query Process',
+        Summary => 'This is the summary of the process for handling queries',
+        CustomFields => [
+            {
+                CustomField  => 'Content',
+                Content => 'This is the content of the process for handling queries',
+            },
+        ],
+        Class => 'Incidents Processes',
+    },
+    {
+        Name => 'Scan Process',
+        Summary => 'This is the summary of the process for handling scans',
+        CustomFields => [
+            {
+                CustomField  => 'Content',
+                Content => 'This is the content of the process for handling scans',
+            },
+        ],
+        Class => 'Incidents Processes',
+    },
+    {
+        Name => 'Denial of Service Process',
+        Summary => 'This is the summary of the process for handling denial of service',
+        CustomFields => [
+            {
+                CustomField  => 'Content',
+                Content => 'This is the content of the process for handling denial of service',
+            },
+        ],
+        Class => 'Incidents Processes',
+    },
+    {
+        Name => 'Piracy Process',
+        Summary => 'This is the summary of the process for handling piracy',
+        CustomFields => [
+            {
+                CustomField  => 'Content',
+                Content => 'This is the content of the process for handling piracy',
+            },
+        ],
+        Class => 'Incidents Processes',
+    }
+);
+
+ at Final = (
+    sub {
+        my $class = RT::Class->new( RT->SystemUser );
+        my ($ok, $msg) = $class->Load('Incidents Processes');
+        RT->Logger->error("Unable to load class Incidents Processes: $msg") unless $ok;
+
+        my $content = RT::CustomField->new( RT->SystemUser );
+        $content->Load('Content');
+
+        my @skips = ( "Name", "Summary", "LinkToTicket", "CF-Title-" . $content->Id );
+        $class->SetAttribute(Name => "Skip-$_", Content => 1) for @skips;
+
+        my $group = RT::Group->new( RT->SystemUser );
+        $group->LoadUserDefinedGroup("DutyTeam");
+        die "Can't load group" unless $group->Id;
+        $group->PrincipalObj->GrantRight( Right => $_, Object => $class )
+            for qw/ShowArticle SeeCustomField AdminClass AdminTopics CreateArticle ModifyArticle ModifyArticleTopics SeeClass ShowArticleHistory DeleteArticle/;
+        }
+);
+
+1;
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index 36a5fc7b..4262c48b 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -270,6 +270,8 @@
 % }
     </&>
 
+    <& /Elements/ShowArticle, Ticket => $Ticket &>
+
 <%PERL>
     my $dates_url      = RT::IR->HREFTo("Edit.html?id=".$Ticket->Id);
     my $dates_inline   = sprintf( $modify_inline, $m->interp->apply_escapes( $dates_url, 'h' ) );
diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index e384faa2..2e08a17f 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -298,6 +298,8 @@
   <div class="boxcontainer col-md-6">
 % $m->callback( %ARGS, Ticket => $TicketObj, CallbackName => 'RightColumnStart' );
 
+<& /Elements/ShowArticle, Ticket => $TicketObj &>
+
 <& /Ticket/Elements/ShowLinkedQueues,
     TicketObj => $TicketObj,
 &>

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

Summary of changes:
 docs/AdministrationTutorial.pod          | 32 +++++++++++
 docs/UPGRADING-5.0                       | 19 +++++++
 etc/RTIR_Config.pm                       | 28 +++++++++
 etc/initialdata                          | 94 ++++++++++++++++++++++++++++++-
 etc/upgrade/process_articles_initialdata | 97 ++++++++++++++++++++++++++++++++
 html/RTIR/Display.html                   |  2 +
 html/RTIR/Incident/Display.html          |  2 +
 7 files changed, 273 insertions(+), 1 deletion(-)
 create mode 100644 etc/upgrade/process_articles_initialdata


hooks/post-receive
-- 
rtir


More information about the rt-commit mailing list