Skip Menu |

This queue is for tickets about the RT-Extension-REST2 CPAN distribution.

Report information
The Basics
Id: 123261
Status: open
Priority: 0/
Queue: RT-Extension-REST2

People
Owner: Nobody in particular
Requestors: jake.murphy [...] faredge.com.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: REST 2.0 Json Query No results Bug
Date: Thu, 12 Oct 2017 22:28:31 +0000
To: "bug-RT-Extension-REST2 [...] rt.cpan.org" <bug-RT-Extension-REST2 [...] rt.cpan.org>
From: Jake Murphy <jake.murphy [...] faredge.com.au>
Hello, Our team has recently added the REST 2.0 module to our RT. We can successfully fetch single tickets/queues/etc using the API, and can search using the simple query method. The problem is I have never managed to get the json query on any of the end points to work. For example following the json query section of the documentation (at https://github.com/bestpractical/rt-extension-rest2), and searching tickets with a simple query: curl -kis -u "<un>:<p>" -X POST "<url>/REST/2.0/tickets" --data-binary '[{"field":"id", "value":"210050"}]' -H 'Content-Type: application/json' Returns no results (even though we have a ticket with id 210050). I have yet to get any kind of results from any of the other JSON search interfaces either. I also attempted to send invalid json (like '[{]}') which should return an error but it also does not. Thanks, Jake Murphy Far Edge Technology PS: I have posted a comment on the rt forum about this: https://forum.bestpractical.com/t/rt-request-tracker-cant-able-to-get-the-tickets-for-query-in-rest-2-0/32271/2, on someone else's similar question.
Subject: RE: [rt.cpan.org #123261] REST 2.0 Json Query No results Bug
Date: Tue, 17 Oct 2017 01:51:38 +0000
To: "bug-RT-Extension-REST2 [...] rt.cpan.org" <bug-RT-Extension-REST2 [...] rt.cpan.org>
From: Jake Murphy <jake.murphy [...] faredge.com.au>
Forgot to add in install details. PERL: 5.18.2 OS: Linux 3.13.0-32-generic #57-Ubuntu WebServer: nginx 1.4.6 Thanks, Jake Show quoted text
-----Original Message----- From: Bugs in RT-Extension-REST2 via RT [mailto:bug-RT-Extension-REST2@rt.cpan.org] Sent: Friday, 13 October 2017 10:03 AM To: Jake Murphy <jake.murphy@faredge.com.au> Subject: [rt.cpan.org #123261] AutoReply: REST 2.0 Json Query No results Bug Greetings, This message has been automatically generated in response to the creation of a trouble ticket regarding: "REST 2.0 Json Query No results Bug", a summary of which appears below. There is no need to reply to this message right now. Your ticket has been assigned an ID of [rt.cpan.org #123261]. Your ticket is accessible on the web at: https://rt.cpan.org/Ticket/Display.html?id=123261 Please include the string: [rt.cpan.org #123261] in the subject line of all future correspondence about this issue. To do so, you may reply to this message. Thank you, bug-RT-Extension-REST2@rt.cpan.org -------------------------------------------------------------------------
On Thu Oct 12 19:02:48 2017, jake.murphy@faredge.com.au wrote: Show quoted text
> Hello, > > Our team has recently added the REST 2.0 module to our RT. > We can successfully fetch single tickets/queues/etc using the API, and > can search using the simple query method. > > The problem is I have never managed to get the json query on any of > the end points to work. > For example following the json query section of the documentation (at > https://github.com/bestpractical/rt-extension-rest2), and searching > tickets with a simple query: > curl -kis -u "<un>:<p>" -X POST "<url>/REST/2.0/tickets" --data-binary > '[{"field":"id", "value":"210050"}]' -H 'Content-Type: > application/json' > > Returns no results (even though we have a ticket with id 210050). > I have yet to get any kind of results from any of the other JSON > search interfaces either. > I also attempted to send invalid json (like '[{]}') which should > return an error but it also does not. > > Thanks, > Jake Murphy > Far Edge Technology > > PS: > I have posted a comment on the rt forum about this: > https://forum.bestpractical.com/t/rt-request-tracker-cant-able-to-get- > the-tickets-for-query-in-rest-2-0/32271/2, on someone else's similar > question.
Ticket queries can be done with GETs like: curl -X GET -u 'root:password' 'http://mytestrt.com:8080/REST/2.0/ticket/48' curl -X GET -u 'root:password' "http://mytestrt.com:8080/REST/2.0/tickets?query='Queue%20=%20General'" Can you create tickets with JSON payload? If not, it could be some additional configuration is required for nginx. curl -X POST -H "Content-Type: application/json" -d '{ "Queue": "General", "Subject": "testing", "From": "test@example.com", "To": "rt@example.com", "Content": "Testing a create"}' -u 'root:password' 'http://mytestrt.com:8080/REST/2.0/ticket' Queues support the extended query syntax. Does this work? curl -X POST --data-binary '[{ "field": "Name", "operator": "LIKE", "value": "General" }]' -u 'root:password' 'http://mytestrt.com:8080/REST/2.0/queues'
Subject: RE: [rt.cpan.org #123261] REST 2.0 Json Query No results Bug
Date: Tue, 17 Oct 2017 23:33:19 +0000
To: "bug-RT-Extension-REST2 [...] rt.cpan.org" <bug-RT-Extension-REST2 [...] rt.cpan.org>
From: Jake Murphy <jake.murphy [...] faredge.com.au>
Hello, Endpoint ticket/:id returns JSON correctly and a 'simple' query also returns results. I can create tickets with a JSON payload. I can search queues using the json syntax (using a different queue name we have). After reviewing my debugging steps for queue json search, it seems I was using lowercase "name" for the field. This will always return no results. I tried many combinations to try and get results from the query, it seems I missed this one. Sorry for missing this and thanks for the help, Jake Murphy Show quoted text
-----Original Message----- From: Best Practical Solutions »|« via RT [mailto:bug-RT-Extension-REST2@rt.cpan.org] Sent: Wednesday, 18 October 2017 12:50 AM To: Jake Murphy <jake.murphy@faredge.com.au> Subject: [rt.cpan.org #123261] REST 2.0 Json Query No results Bug <URL: https://rt.cpan.org/Ticket/Display.html?id=123261 > On Thu Oct 12 19:02:48 2017, jake.murphy@faredge.com.au wrote:
> Hello, > > Our team has recently added the REST 2.0 module to our RT. > We can successfully fetch single tickets/queues/etc using the API, and > can search using the simple query method. > > The problem is I have never managed to get the json query on any of > the end points to work. > For example following the json query section of the documentation (at > https://github.com/bestpractical/rt-extension-rest2), and searching > tickets with a simple query: > curl -kis -u "<un>:<p>" -X POST "<url>/REST/2.0/tickets" --data-binary > '[{"field":"id", "value":"210050"}]' -H 'Content-Type: > application/json' > > Returns no results (even though we have a ticket with id 210050). > I have yet to get any kind of results from any of the other JSON > search interfaces either. > I also attempted to send invalid json (like '[{]}') which should > return an error but it also does not. > > Thanks, > Jake Murphy > Far Edge Technology > > PS: > I have posted a comment on the rt forum about this: > https://forum.bestpractical.com/t/rt-request-tracker-cant-able-to-get- > the-tickets-for-query-in-rest-2-0/32271/2, on someone else's similar > question.
Ticket queries can be done with GETs like: curl -X GET -u 'root:password' 'http://mytestrt.com:8080/REST/2.0/ticket/48' curl -X GET -u 'root:password' "http://mytestrt.com:8080/REST/2.0/tickets?query='Queue%20=%20General'" Can you create tickets with JSON payload? If not, it could be some additional configuration is required for nginx. curl -X POST -H "Content-Type: application/json" -d '{ "Queue": "General", "Subject": "testing", "From": "test@example.com", "To": "rt@example.com", "Content": "Testing a create"}' -u 'root:password' 'http://mytestrt.com:8080/REST/2.0/ticket' Queues support the extended query syntax. Does this work? curl -X POST --data-binary '[{ "field": "Name", "operator": "LIKE", "value": "General" }]' -u 'root:password' 'http://mytestrt.com:8080/REST/2.0/queues' -- Message protected by MailGuard: e-mail anti-virus, anti-spam and content filtering. http://www.mailguard.com.au Click here to report this message as spam: https://console.mailguard.com.au/ras/1RToJsVGkP/5dsWmwRK3uy1DB9vAdqLxm/0.5
Subject: RE: [rt.cpan.org #123261] REST 2.0 Json Query No results Bug
Date: Wed, 18 Oct 2017 00:30:56 +0000
To: "bug-RT-Extension-REST2 [...] rt.cpan.org" <bug-RT-Extension-REST2 [...] rt.cpan.org>
From: Jake Murphy <jake.murphy [...] faredge.com.au>
Actually on closer inspection I can't seem to search on ticket id. For example the query: curl -X POST --data-binary '[{ "field": "Id", "value": 45 }]' -u 'root:password' '<url>/REST/2.0/tickets' Will return nothing even though we do have a ticket with an id 45. (lowercase id and uppercase id doesn't seem to help) Queues and groups work this way (id is searchable). Tickets and users do not work this way (see above example). Adding -H 'Content-Type: application/json' to the request doesn't seem to help either. Thanks, Jake Show quoted text
-----Original Message----- From: Best Practical Solutions »|« via RT [mailto:bug-RT-Extension-REST2@rt.cpan.org] Sent: Wednesday, 18 October 2017 12:50 AM To: Jake Murphy <jake.murphy@faredge.com.au> Subject: [rt.cpan.org #123261] REST 2.0 Json Query No results Bug <URL: https://rt.cpan.org/Ticket/Display.html?id=123261 > On Thu Oct 12 19:02:48 2017, jake.murphy@faredge.com.au wrote:
> Hello, > > Our team has recently added the REST 2.0 module to our RT. > We can successfully fetch single tickets/queues/etc using the API, and > can search using the simple query method. > > The problem is I have never managed to get the json query on any of > the end points to work. > For example following the json query section of the documentation (at > https://github.com/bestpractical/rt-extension-rest2), and searching > tickets with a simple query: > curl -kis -u "<un>:<p>" -X POST "<url>/REST/2.0/tickets" --data-binary > '[{"field":"id", "value":"210050"}]' -H 'Content-Type: > application/json' > > Returns no results (even though we have a ticket with id 210050). > I have yet to get any kind of results from any of the other JSON > search interfaces either. > I also attempted to send invalid json (like '[{]}') which should > return an error but it also does not. > > Thanks, > Jake Murphy > Far Edge Technology > > PS: > I have posted a comment on the rt forum about this: > https://forum.bestpractical.com/t/rt-request-tracker-cant-able-to-get- > the-tickets-for-query-in-rest-2-0/32271/2, on someone else's similar > question.
Ticket queries can be done with GETs like: curl -X GET -u 'root:password' 'http://mytestrt.com:8080/REST/2.0/ticket/48' curl -X GET -u 'root:password' "http://mytestrt.com:8080/REST/2.0/tickets?query='Queue%20=%20General'" Can you create tickets with JSON payload? If not, it could be some additional configuration is required for nginx. curl -X POST -H "Content-Type: application/json" -d '{ "Queue": "General", "Subject": "testing", "From": "test@example.com", "To": "rt@example.com", "Content": "Testing a create"}' -u 'root:password' 'http://mytestrt.com:8080/REST/2.0/ticket' Queues support the extended query syntax. Does this work? curl -X POST --data-binary '[{ "field": "Name", "operator": "LIKE", "value": "General" }]' -u 'root:password' 'http://mytestrt.com:8080/REST/2.0/queues' -- Message protected by MailGuard: e-mail anti-virus, anti-spam and content filtering. http://www.mailguard.com.au Click here to report this message as spam: https://console.mailguard.com.au/ras/1RToJsVGkP/5dsWmwRK3uy1DB9vAdqLxm/0.5