[Bps-public-commit] rt-extension-rest2 branch, master, updated. 1.03-7-g66b29f5

Jim Brandt jbrandt at bestpractical.com
Mon Jul 2 15:40:57 EDT 2018


The branch, master has been updated
       via  66b29f5b82a1a41c0b8c8b40f634a3bcbcab007e (commit)
       via  e4772a981554c22fad0cb974e0d2ed23e84b8e73 (commit)
       via  4f4999f63c1de763ac146ceb8564e33f1020bc35 (commit)
      from  6d0a63516d42cff34826a38998dee84e6bb13c96 (commit)

Summary of changes:
 README                                             | 23 ++++++++++++++++++++--
 inc/YAML/Tiny.pm                                   |  6 +++---
 lib/RT/Extension/REST2/Resource/Record/Writable.pm |  2 +-
 3 files changed, 25 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit 4f4999f63c1de763ac146ceb8564e33f1020bc35
Author: craig Kaiser <craig at bestpractical.com>
Date:   Wed Mar 21 14:57:09 2018 -0400

    Add Asset examples

diff --git a/README b/README
index 042cb5c..18aa7fa 100644
--- a/README
+++ b/README
@@ -267,10 +267,29 @@ USAGE
 
         # 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'
 
+        # 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'
+
+        # Create an Asset
+        curl -X POST -H "Content-Type: application/json" -u 'root:password'
+            -d '{"Name" : "Asset From Rest", "Catalog" : "General assets", "Content" : "Some content"}'
+            'https://myrt.com/REST/2.0/asset'
+
+        # Search Assets
+        curl -X POST -H "Content-Type: application/json" -u 'root:password'
+        -d '[{ "field" : "id", "operator" : ">=", "value" : 0 }]'
+        'https://myrt.com/REST/2.0/asset'
+
    Transactions
         GET /transactions?query=<JSON>
         POST /transactions

commit e4772a981554c22fad0cb974e0d2ed23e84b8e73
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Jul 2 15:37:52 2018 -0400

    Use the variable $id rather than literal id when removing cfs
    
    This bug manifested with the behavior the comment notes this
    code is intended to prevent, namely that after a create, each
    custom field value is still updated, creating an additional
    transaction record.

diff --git a/lib/RT/Extension/REST2/Resource/Record/Writable.pm b/lib/RT/Extension/REST2/Resource/Record/Writable.pm
index 490e2be..aa548dd 100644
--- a/lib/RT/Extension/REST2/Resource/Record/Writable.pm
+++ b/lib/RT/Extension/REST2/Resource/Record/Writable.pm
@@ -278,7 +278,7 @@ sub create_record {
     if ($record->isa('RT::Ticket') || $record->isa('RT::Asset')) {
         if ($cfs) {
             while (my ($id, $value) = each(%$cfs)) {
-                delete $cfs->{id};
+                delete $cfs->{$id};
                 $args{"CustomField-$id"} = $value;
             }
         }

commit 66b29f5b82a1a41c0b8c8b40f634a3bcbcab007e
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Jul 2 15:40:05 2018 -0400

    Update Module::Install file

diff --git a/inc/YAML/Tiny.pm b/inc/YAML/Tiny.pm
index 4fd023d..fb157a6 100644
--- a/inc/YAML/Tiny.pm
+++ b/inc/YAML/Tiny.pm
@@ -2,12 +2,12 @@
 use 5.008001; # sane UTF-8 support
 use strict;
 use warnings;
-package YAML::Tiny; # git description: v1.69-8-g2c1e266
+package YAML::Tiny; # git description: v1.72-7-g8682f63
 # XXX-INGY is 5.8.1 too old/broken for utf8?
 # XXX-XDG Lancaster consensus was that it was sufficient until
 # proven otherwise
 
-our $VERSION = '1.70';
+our $VERSION = '1.73';
 
 #####################################################################
 # The YAML::Tiny API.
@@ -374,7 +374,7 @@ sub _load_scalar {
     while ( @$lines ) {
         $lines->[0] =~ /^(\s*)/;
         last unless length($1) >= $indent->[-1];
-        push @multiline, substr(shift(@$lines), length($1));
+        push @multiline, substr(shift(@$lines), $indent->[-1]);
     }
 
     my $j = (substr($string, 0, 1) eq '>') ? ' ' : "\n";

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


More information about the Bps-public-commit mailing list