Full text search via SOAP and GenericTicketConnector

Moderator: crythias

Locked
frdmn
Znuny newbie
Posts: 10
Joined: 18 Nov 2015, 11:43
Znuny Version: 5.0.0

Full text search via SOAP and GenericTicketConnector

Post by frdmn »

Hello,

I'm trying to perform a full text search (just like the web does when I type something into the search module and don't add any filters) via the Python SOAP client and GenericTicketConnector:

Code: Select all

#!/usr/bin/env python

from otrs.client import GenericTicketConnector
from otrs.objects import Ticket, Article, DynamicField, Attachment

import yaml
config = yaml.safe_load(open("config.yml"))

server_uri = config['server']
webservice_name = 'GenericTicketConnector'
client = GenericTicketConnector(server_uri, webservice_name)

# user session
client.user_session_register(config['username'], config['password'])

# returns all tickets in queue Support
tickets = client.ticket_search(
    Queues = 'Support Queue',
    From = '<term>',
    To = '<term>',
    Cc = '<term>',
    Subject = '<term>',
    Body = '<term>',
    ContentSearch = 'OR'
)

print tickets
I have no clue if the parameters are okay and supposed to be set like that. All I know is that it doesn't work right now and I am at the end of ideas what I could do to make it work.

Don't judge about my Python skills, I'm not really good with this :?

Can someone help me out?
frdmn
Znuny newbie
Posts: 10
Joined: 18 Nov 2015, 11:43
Znuny Version: 5.0.0

Re: Full text search via SOAP and GenericTicketConnector

Post by frdmn »

Not sure if I am allowed to bump but since there is still no reply since 5 days:

bump :P
root
Administrator
Posts: 4253
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Full text search via SOAP and GenericTicketConnector

Post by root »

I'm not good with Python too, but the parameter you'll need can be found here: https://otrs.github.io/doc/api/otrs/4.0 ... ch.pm.html
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
frdmn
Znuny newbie
Posts: 10
Joined: 18 Nov 2015, 11:43
Znuny Version: 5.0.0

Re: Full text search via SOAP and GenericTicketConnector

Post by frdmn »

Thanks @root,

That's the resource I've already found and what my current parameters are based on, but still can't figure out how to do the full text search :(
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Full text search via SOAP and GenericTicketConnector

Post by crythias »

Repeat the search needle in Subject and bodyand possibly send fulltextindex flag.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
frdmn
Znuny newbie
Posts: 10
Joined: 18 Nov 2015, 11:43
Znuny Version: 5.0.0

Re: Full text search via SOAP and GenericTicketConnector

Post by frdmn »

@crythias Thanks for the reply, but isn't that already what I tried above?

Code: Select all

tickets = client.ticket_search(
    Queues = 'Support Queue',
    From = '{{term}}',
    To = '{{term}}',
    Cc = '{{term}}',
    Subject = '{{term}}',
    Body = '{{term}}',
    ContentSearch = 'OR',
    FullTextIndex = 1
)
Edit: in my original thread, i didn't used "FullTextIndex" but adding that, doesn't do any difference :/
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Full text search via SOAP and GenericTicketConnector

Post by crythias »

you may want to put % around string.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
frdmn
Znuny newbie
Posts: 10
Joined: 18 Nov 2015, 11:43
Znuny Version: 5.0.0

Re: Full text search via SOAP and GenericTicketConnector

Post by frdmn »

@crythias just tried adding "%" as well as "*" but none of those made a difference regarding the results.

In both cases SOAP just returns an empty array.

If there's an alternative to the SOAP API, I would be happy to use that as well. I just want to search full text :P
frdmn
Znuny newbie
Posts: 10
Joined: 18 Nov 2015, 11:43
Znuny Version: 5.0.0

Re: Full text search via SOAP and GenericTicketConnector

Post by frdmn »

Any ideas?
frdmn
Znuny newbie
Posts: 10
Joined: 18 Nov 2015, 11:43
Znuny Version: 5.0.0

Re: Full text search via SOAP and GenericTicketConnector

Post by frdmn »

bump

Hopefully someone else has an idea.
frdmn
Znuny newbie
Posts: 10
Joined: 18 Nov 2015, 11:43
Znuny Version: 5.0.0

Re: Full text search via SOAP and GenericTicketConnector

Post by frdmn »

Sorry for bumping again, but I would really like to know about this. Also I try to not spam-bump (2 weeks in between bumps).

Thank you guys.
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: Full text search via SOAP and GenericTicketConnector

Post by EXG133 »

What do you see in the webservice debugger? You could also create a REST webservice, perhaps that's easier to work with.
frdmn
Znuny newbie
Posts: 10
Joined: 18 Nov 2015, 11:43
Znuny Version: 5.0.0

Re: Full text search via SOAP and GenericTicketConnector

Post by frdmn »

Thanks for the reply, @EXG133. I just took a look into our webservice debugger and I can see every incomming request but no anormalies or failures.

Regarding the REST service: I'm not sure if this will fix my problem since it uses the same search parameters and options like the SOAP one. But for the SOAP one I can use the great python-otrs API client.and don't have to reinvent the wheel.
frdmn
Znuny newbie
Posts: 10
Joined: 18 Nov 2015, 11:43
Znuny Version: 5.0.0

Re: Full text search via SOAP and GenericTicketConnector

Post by frdmn »

I did some troubleshooting with @ewsterrenburg and thanks to his help we found out that this is apparently a bug in the current API implementation:

For anyone who wants to read what happend in specific, here's the GitHub issue: https://github.com/ewsterrenburg/python-otrs/issues/10

Erwin also sent out a message to the mailing list to reach out the developers. Hopefully we get a response there soon :)

https://groups.google.com/forum/#!topic ... -nV7n-ezn4
Locked