Giter VIP home page Giter VIP logo

Comments (27)

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

As far as I can see, ContentSearch = 'OR' is being ignored by the OTRS Generic Ticketconnector.

When I do some testing, the results appear as if only results are given back for which each of the conditions specified is True. This behavior occurs both calling the TicketConnector from Python and when testing the GenericTicket connector directly using SoapUI.

@frdmn could you do some testing if you agree with me that the ticket connector checks for each condition regardless of the value supplied for ContentSearch? If so, we could file a bug report with OTRS itself.

from python-otrs.

frdmn avatar frdmn commented on July 28, 2024

@ewsterrenburg I would love to debug/test this with you! I already spent several months trying to get a proper response from the OTRS team, but no-one really could help me out yet.

Let me know when and how you need my help 👍

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

Doesn't sound really hopeful, since I suspect the issue is located within OTRS itself...

@frdmn Could you please check if a request of the following nature only returns you the tickets for which the string being searched for (I used "test", use something that is present in your tickets ;)) occurs both in the subject and body of the ticket. If so, I will put it up on the OTRS mailing list

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns="http://www.otrs.org/TicketConnector/">
  <soapenv:Header/>
  <soapenv:Body>
  <TicketSearch>
           <UserLogin>username</UserLogin>
         <Password>password</Password>
  <Body>test</Body>
  <Subject>test</Subject>
  <ContentSearch>OR</ContentSearch>
</TicketSearch>
  </soapenv:Body>
</soapenv:Envelope>

from python-otrs.

frdmn avatar frdmn commented on July 28, 2024

Not sure if I do this right, but I setup SoapUI, downloaded the WSDL, imported it and tried the following request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns="http://www.otrs.org/TicketConnector/">
  <soapenv:Header/>
  <soapenv:Body>
    <TicketSearch>
     <UserLogin>jonas.friedmann</UserLogin>
     <Password>[password]</Password>
     <Body>RapidSSL</Body>
     <Subject>RapidSSL</Subject>
     <ContentSearch>OR</ContentSearch>
   </TicketSearch>
 </soapenv:Body>
</soapenv:Envelope>

Which returns the following (error) response:

<soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
      <Fault xmlns="http://www.otrs.org/TicketConnector/">
         <faultcode>Server</faultcode>
         <faultstring>Namespace from SOAPAction 'http://www.otrs.org/TicketConnector' does not match namespace from configuration 'http://www.otrs.org/TicketConnector/'</faultstring>
      </Fault>
   </soap:Body>
</soap:Envelope>

Did I miss anything?

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

Don't know, it's working for me. But you could also test it using your python code I guess...

from python-otrs.

frdmn avatar frdmn commented on July 28, 2024

Interesting, works for me via python-otrs but not via raw SOAP. I'm going to take a look in the Webservice Debugger and try to compare both requests to see the differences. Stay tuned :)

from python-otrs.

frdmn avatar frdmn commented on July 28, 2024

Here's the request received from the debugger:

Comparison:

2,3c2,3
<   'CONTENT_LENGTH' => '422',
<   'CONTENT_TYPE' => 'text/xml;charset=UTF-8',
---
>   'CONTENT_LENGTH' => '388',
>   'CONTENT_TYPE' => 'text/xml;charset=utf-8',
7,8c7,8
<   'HTTP_ACCEPT_ENCODING' => 'gzip,deflate',
<   'HTTP_CONNECTION' => 'Keep-Alive',
---
>   'HTTP_ACCEPT_ENCODING' => 'identity',
>   'HTTP_CONNECTION' => 'close',
10,11c10
<   'HTTP_SOAPACTION' => '"http://www.otrs.org/TicketConnector/TicketSearch"',
<   'HTTP_USER_AGENT' => 'Apache-HttpClient/4.1.1 (java 1.5)',
---
>   'HTTP_USER_AGENT' => 'Python-urllib/2.7',
19c18
<   'REMOTE_PORT' => '56885',
---
>   'REMOTE_PORT' => '56379',
30c29,30
<   'SERVER_SOFTWARE' => 'Apache/2.2.16 (Debian)'
---
>   'SERVER_SOFTWARE' => 'Apache/2.2.16 (Debian)',
>   'SSL_TLS_SNI' => 'ticket.intern.company.de'

My guess is that the HTTP_SOAPACTION makes the request invalid out of SoapUI. I have no clue how that got in there though - I assume because I imported the WSDL?

from python-otrs.

frdmn avatar frdmn commented on July 28, 2024

@ewsterrenburg Finally got it working! Apparently the SOAPACTION is a SoapUI-specific behaviour(?). I just tried to send the raw HTTP request using Postman and that immediately worked like a charm.

Regarding your actual question: I've picked a ticket which contains a really unique ticket number from a remote ticket system (2016031410000296) only in the subject, but not in the body.

Now I tried a SOAP request like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns="http://www.otrs.org/TicketConnector/">
  <soapenv:Header/>
  <soapenv:Body>
    <TicketSearch>
     <UserLogin>jonas.friedmann</UserLogin>
     <Password>[password]</Password>
     <Body>2016031410000296</Body>
     <Subject>2016031410000296</Subject>
     <ContentSearch>OR</ContentSearch>
   </TicketSearch>
 </soapenv:Body>
</soapenv:Envelope>

And this is what I've received:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Body>
        <TicketSearchResponse xmlns="http://www.otrs.org/TicketConnector/" xsi:nil="true" />
    </soap:Body>
</soap:Envelope>

Ergo, the response is completely empty even though, it should actually list at least one ticket ID.

To cross check this problem I removed either <Body> or <Subject>, and it returned the proper ticket ID as expected.

I guess this confirms our assumptions, right?

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

@frdmn I agree.
Will you report this to the OTRS development team or should I do so?

from python-otrs.

frdmn avatar frdmn commented on July 28, 2024

@ewsterrenburg I am not really familiar with mailing lists, so it would be nice if you could submit it. If you have more important stuff to do right now, I can also try to o it :)

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

Posted it on the OTRS mailinglist

from python-otrs.

frdmn avatar frdmn commented on July 28, 2024

Thank you! Now let's wait patiently for a response :)

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

@frdmn
no reaction on the mailing list. Reported it with the otrs bugtracker:
http://bugs.otrs.org/show_bug.cgi?id=11981

from python-otrs.

frdmn avatar frdmn commented on July 28, 2024

🙂👍

Von meinem iPhone gesendet

Am 04.04.2016 um 15:43 schrieb ewsterrenburg [email protected]:

@frdmn
no reaction on the mailing list. Reported it with the otrs bugtracker:
http://bugs.otrs.org/show_bug.cgi?id=11981


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

from python-otrs.

frennkie avatar frennkie commented on July 28, 2024

I have been working on a Python implementation for the OTRS API over the last few days which - I'll have to admit - actually does the same thing as you have done here. But I really did not want to touch that SOAP stuff and am using the REST interface.
i believe I have run into the same issue with my project as you have:

In [10]: client.ticket_search(Subject="%worldwide%")
DEBUG:pyotrs.client:{}
DEBUG:pyotrs.client:search found no results
Out[10]: []

In [11]: client.ticket_search(Body="%worldwide%")
DEBUG:pyotrs.client:{u'TicketID': [u'1']}
Out[11]: [u'1']

In [12]: client.ticket_search(Body="%worldwide%",Subject="%worldwide%",ContentSearch="OR")
DEBUG:pyotrs.client:{}
DEBUG:pyotrs.client:search found no results
Out[12]: []

The only ticket I have in my system is the initial "Welcome to OTRS" which has "worldwide" in it's body, so the ticket should also be found in my [12] example, right?!

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

@frennkie
I agree with you on this one and expect that ticket to be found...
It keeps being quiet on both OTRS mailinglist and Bugtracker though.

Since @frdmn has similar experiences of proper responses lacking, priority for the dev team seems to be low. Fortunately, I am not using full text searches anyway.

from python-otrs.

frennkie avatar frennkie commented on July 28, 2024

@ewsterrenburg I assume you have absolutely no intention on using/switch to REST as you already have a full SOAP implementation, right? I have not yet published my code but am planning to do so (possibly as "PyOTRS"). Any objections from your side?

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

@frennkie

No objections at all and neither any intention to use/switch to REST at the moment.
Generally I like REST better as well, yet there were two reasons have chosen SOAP:

  1. Me being totally clueless how to set up the REST service within OTRS
  2. A perfectly fine solution for SOAP was already available created by @JocelynDelalande which I could extend.

from python-otrs.

frennkie avatar frennkie commented on July 28, 2024

@ewsterrenburg I think you got the wrong frennkie there.. I'm @frennkie ;-)
Otherwise I completely understand you.
Setting up the OTRS REST service is actually very easy and done in two minutes. All you need to do is download the example .yml config from the OTRS repo and upload it as a new web service:
https://github.com/OTRS/otrs/tree/master/development/webservices

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

@frennkie
ups, so many fren(n)kies in this world...

Ok, that doesn't seem difficult. Nonetheless I was being clueless when I installed OTRS while the SOAP service worked right away. So, maybe it's possible to switch someday, yet for now SOAP service does it's job perfectly fine :)

from python-otrs.

frdmn avatar frdmn commented on July 28, 2024

@frennkie Perhaps you could "+1" the issue in the bug tracker so the OTRS dev team notice the demand of a fix for this problem.

Right now, my original project is kind of abandoned because it depends on a full text search in OTRS :/

I already thought about just scraping the web page instead for now...

from python-otrs.

frennkie avatar frennkie commented on July 28, 2024

@frdmn I already posted a follow up in the OTRS tracker to Bug 11981.

from python-otrs.

frdmn avatar frdmn commented on July 28, 2024

@frennkie Oh, I saw Robert's comments but didn't realize it's you. Thanks buddy! 👍

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

Issue is clear. Is now fixed in OTRS (at least in OTRS5). Will close this issue.

from python-otrs.

frdmn avatar frdmn commented on July 28, 2024

👍

from python-otrs.

Filterer avatar Filterer commented on July 28, 2024

Hi all,

I know that this issue is closed but I have the same problem when trying to search tickets based on their article fields (subject, body etc). I m having OTRS 6 on ubuntu and I am executing queries with curl in the terminal. OTRS is also configured as an Invoker with REST and I am using the common GenericTicketConnectorREST webservice with the basic ticket and session functions.

For example:
This query works and searches for tickets with a specific title and the ones that belong to the 'Raw' queue.
curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket?SessionID=xLHFqyIbO9OUDZypaFGSVDbe3sA0v3NF&Title=some+title&Queues=Raw"

But this one that searches for tickets with a specific subject it doesn't work and returns all the existing tickets on the OTRS server.
curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket?SessionID=xLHFqyIbO9OUDZypaFGSVDbe3sA0v3NF&Subject=some+subject"

Same problem exists for the From, To, CC and Body. ContentSearch and FullTextIndex don't make a difference as well. Also AttachmentName doesn't seem to work as well but that is not article related I guess.

Any help will be appreciated.

from python-otrs.

ewsterrenburg avatar ewsterrenburg commented on July 28, 2024

@Filterer
Am I correct that you are not experiencing an issue with the python-otrs library, yet with OTRS itself?

If so, could you please try the OTRS mailing list or one of the OTRS related forums for help...

from python-otrs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.