Searchparameters in URL - more than one filter?

Moderator: crythias

Post Reply
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Searchparameters in URL - more than one filter?

Post by PhyrePhoX »

Hi,

following up on viewtopic.php?f=53&t=41079&p=165873#p165873

I have a question:

Code: Select all

https://xyz.net/otrs/index.pl?Action=AgentTicketSearch;Subaction=Search;StateType=merged;ShownAttributes=LabelSearch_DynamicField_masterticket;Search_DynamicField_masterticket=[% Data.masterticket | uri %]
This shows me all the tickets that are in state MERGED. However, i want the exact opposite, showing all the tickets that are NOT in state merged.
How would i have to define stateType=nonmerged?

I already tried separating the "allowed" states with commas, with "|" or with "OR" but no luck. How can i run a search that shows ticket in state open, new & closed?
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
skullz
Znuny superhero
Posts: 621
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

Re: Searchparameters in URL - more than one filter?

Post by skullz »

Try

StateType=new;StateType=open;StateType=pending reminder;

Good luck
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Re: Searchparameters in URL - more than one filter?

Post by PhyrePhoX »

skullz wrote: 04 Mar 2020, 02:06 Try

StateType=new;StateType=open;StateType=pending reminder;

Good luck
Thank you, but unfortunately, that doesnt work either - it only used the first mentioned statetype (in this case: "new"). There has to be a way to use some kind of array, i guess!?
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Re: Searchparameters in URL - more than one filter?

Post by PhyrePhoX »

StateID=1,2,3 etc also doesnt seem to work
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Re: Searchparameters in URL - more than one filter?

Post by PhyrePhoX »

putting it like StateType={new,closed} or StateType={'new','closed'} or StateType={'new';'closed'} also doesnt work
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
root
Administrator
Posts: 3961
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Searchparameters in URL - more than one filter?

Post by root »

Hi,

See https://github.com/OTRS/otrs/blob/rel-6 ... ch.pm#L227 and https://github.com/OTRS/otrs/blob/rel-6 ... ch.pm#L287 for possible parameters.

Working example: /otrs/index.pl?Action=AgentTicketSearch;StateIDs=4;StateIDs=1;Subaction=Search

- Roy
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 ?
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Re: Searchparameters in URL - more than one filter?

Post by PhyrePhoX »

root wrote: 04 Mar 2020, 19:57 Hi,

See https://github.com/OTRS/otrs/blob/rel-6 ... ch.pm#L227 and https://github.com/OTRS/otrs/blob/rel-6 ... ch.pm#L287 for possible parameters.

Working example: /otrs/index.pl?Action=AgentTicketSearch;StateIDs=4;StateIDs=1;Subaction=Search

- Roy
That did the trick, thank you!
Any idea why it works this way with StateIDs and not with stateType?
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
root
Administrator
Posts: 3961
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Searchparameters in URL - more than one filter?

Post by root »

Hi,

See the second link, it will work with StateTypeIDs - I'm not responsible for the implemented params ;-)

- Roy
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 ?
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Re: Searchparameters in URL - more than one filter?

Post by PhyrePhoX »

Thank you for your help.
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
Post Reply