[Bps-public-commit] rt-extension-rest2 branch, create-ticket-with-content, repushed
Jim Brandt
jbrandt at bestpractical.com
Thu May 2 17:32:40 EDT 2019
The branch create-ticket-with-content was deleted and repushed:
was ffd6a4076ac05897cc24feb3a6fbaeb3c4914c4c
now ddfa86031109c50e87b671667980a8c671f3d1d5
1: ffd6a40 ! 1: 6b6b374 Support to create ticket with content
@@ -8,14 +8,13 @@
curl -X POST -H "Content-Type: application/json" -u 'root:password'
-d '{ "Queue": "General", "Subject": "Create ticket test",
- "From": "user1 at example.com", "To": "rt at example.com",
"Content": "Testing a create",
"CustomFields": {"Severity": "Low"}}'
'https://myrt.com/REST/2.0/ticket'
To add content on ticket create, we need to build a MIME object to feed
RT::Ticket::Create, and the following fields will be used to build the
- MIME object: Subject, From, To, Cc, Date, ContentType and Content, which
+ MIME object:ContentType and Content, which
HTML::Mason::Commands::MakeMIMEEntity supports now.
diff --git a/lib/RT/Extension/REST2/Resource/Ticket.pm b/lib/RT/Extension/REST2/Resource/Ticket.pm
@@ -30,12 +29,10 @@
+ Interface => 'REST',
+ Body => delete $data->{Content},
+ Type => delete $data->{ContentType} || 'text/plain',
-+ ( map { $_ => delete $data->{$_} } grep { defined $data->{$_} } qw/From To Date/ ),
-+ # Keep Subject and Cc since they are valid parameters of RT::Ticket::Create
-+ ( map { $_ => $data->{$_} } grep { defined $data->{$_} } qw/Subject Cc/ ),
+ );
+ }
+
my ($ok, $txn, $msg) = $self->_create_record($data);
return ($ok, $msg);
}
+
-: ------- > 2: d0210c3 Correct create ticket example to use Requestor, Cc
-: ------- > 3: ddfa860 Remove unimplemented From and To from tests
More information about the Bps-public-commit
mailing list