How could I search by a dynamic field?

Moderator: crythias

Locked
ness
Znuny newbie
Posts: 5
Joined: 01 Jun 2015, 17:21
Znuny Version: 4.0.7
Real Name: Nestor Ruiz de Infante

How could I search by a dynamic field?

Post by ness »

I want to add a dynamic field in the REST web service search URL.

This example find the tickets which contains the word test in the title. This works well:

Code: Select all

http://OTRS_IP/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket?UserLogin=usr&Password=pss&Title=*test*
Now, I want to add a dynamic field to this search I tried this:

Code: Select all

http://OTRS_IP/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket?UserLogin=usr&Password=pss&Title=*test*&DynamicField_MyField=MyValue
but it doesn't work.

Could someone help me?
adminrd
Znuny newbie
Posts: 39
Joined: 29 Aug 2013, 15:14
Znuny Version: 5.0.9

Re: How could I search by a dynamic field?

Post by adminrd »

Hi ness,
I have same problem actually.
Did you find a solution ?

Thanks and regards,
root
Administrator
Posts: 4250
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: How could I search by a dynamic field?

Post by root »

Here is the documentation: https://otrs.github.io/doc/api/otrs/sta ... ch.pm.html

You also have to specify a search operator like Equals, Like, etc
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 ?
adminrd
Znuny newbie
Posts: 39
Joined: 29 Aug 2013, 15:14
Znuny Version: 5.0.9

[SOLVED]Re: How could I search by a dynamic field?

Post by adminrd »

Hi,
Thanks for the documentation.
It works for me like this:

Code: Select all

 curl -X GET --data '{"DynamicField_FieldNameX": {"Equals":["28537"]}}' "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/TicketSearch?UserLogin=myuser&Password=mypass"
And with this help: http://stackoverflow.com/questions/3061 ... uery-param

Regards,
Locked