[Bps-public-commit] rt-extension-rest2 branch, master, updated. 1.03-3-g14f4fe3

? sunnavy sunnavy at bestpractical.com
Mon Mar 19 12:47:24 EDT 2018


The branch, master has been updated
       via  14f4fe32a38d5af4c7dc33b6aab4fc2bddd58c2b (commit)
       via  27ed014a0e882f59e448f6b7163af6e12b7fc19e (commit)
       via  1e487bf78f46bc9079004f083e186d92465a176e (commit)
      from  8062b56059407f49694aea54de20257e79de6b9f (commit)

Summary of changes:
 lib/RT/Extension/REST2.pm                  | 13 +++++++++++--
 lib/RT/Extension/REST2/Resource/Message.pm |  1 +
 2 files changed, 12 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 1e487bf78f46bc9079004f083e186d92465a176e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Mar 20 00:00:19 2018 +0800

    Import error_as_json for Message.pm that uses it

diff --git a/lib/RT/Extension/REST2/Resource/Message.pm b/lib/RT/Extension/REST2/Resource/Message.pm
index 3a6cfa4..57c8ef1 100644
--- a/lib/RT/Extension/REST2/Resource/Message.pm
+++ b/lib/RT/Extension/REST2/Resource/Message.pm
@@ -6,6 +6,7 @@ use Moose;
 use namespace::autoclean;
 
 extends 'RT::Extension::REST2::Resource';
+use RT::Extension::REST2::Util qw( error_as_json );
 
 sub dispatch_rules {
     Path::Dispatcher::Rule::Regex->new(

commit 27ed014a0e882f59e448f6b7163af6e12b7fc19e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Mar 20 00:31:13 2018 +0800

    Fix ticket update example as Content parameter is not supported
    
    Instead, use /correspond or /comment to add more contents.

diff --git a/lib/RT/Extension/REST2.pm b/lib/RT/Extension/REST2.pm
index ee73b7d..ebb8809 100644
--- a/lib/RT/Extension/REST2.pm
+++ b/lib/RT/Extension/REST2.pm
@@ -303,8 +303,7 @@ Below are some examples using the endpoints above.
 
     # Update a ticket, with a custom field update
     curl -X PUT -H "Content-Type: application/json" -u 'root:password'
-        -d '{ "Subject": "Update test", "Content": "Testing an update",
-            "CustomFields": {"Severity": "High"}}'
+        -d '{ "Subject": "Update test", "CustomFields": {"Severity": "High"}}'
         'https://myrt.com/REST/2.0/ticket/6'
 
 =head3 Transactions

commit 14f4fe32a38d5af4c7dc33b6aab4fc2bddd58c2b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Mar 20 00:33:41 2018 +0800

    Add Correspond/Comment examples

diff --git a/lib/RT/Extension/REST2.pm b/lib/RT/Extension/REST2.pm
index ebb8809..e720a66 100644
--- a/lib/RT/Extension/REST2.pm
+++ b/lib/RT/Extension/REST2.pm
@@ -306,6 +306,16 @@ Below are some examples using the endpoints above.
         -d '{ "Subject": "Update test", "CustomFields": {"Severity": "High"}}'
         'https://myrt.com/REST/2.0/ticket/6'
 
+    # Correspond a ticket
+    curl -X POST -H "Content-Type: application/json" -u 'root:password'
+        -d '{ "Content": "Testing a correspondence", "ContentType": "text/plain" }'
+        'https://myrt.com/REST/2.0/ticket/6/correspond'
+
+    # Comment a ticket
+    curl -X POST -H "Content-Type: text/plain" -u 'root:password'
+        -d 'Testing a comment'
+        'https://myrt.com/REST/2.0/ticket/6/comment'
+
 =head3 Transactions
 
     GET /transactions?query=<JSON>

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


More information about the Bps-public-commit mailing list