Searchparameters in URL - more than one filter?

Moderator: crythias

Post Reply
PhyrePhoX
OTRS advanced
Posts: 107
Joined: 05 Dec 2007, 10:56
OTRS 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)

skullz
OTRS expert
Posts: 279
Joined: 24 Feb 2012, 03:58
OTRS Version?: OTRS 6
Real Name: Skullz
Contact:

Re: Searchparameters in URL - more than one filter?

Post by skullz »

Try

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

Good luck

PhyrePhoX
OTRS advanced
Posts: 107
Joined: 05 Dec 2007, 10:56
OTRS 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)

PhyrePhoX
OTRS advanced
Posts: 107
Joined: 05 Dec 2007, 10:56
OTRS 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)

PhyrePhoX
OTRS advanced
Posts: 107
Joined: 05 Dec 2007, 10:56
OTRS 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)

root
Moderator
Posts: 2224
Joined: 18 Dec 2007, 12:23
OTRS Version?: 4/5/6
Real Name: Roy Kaldung
Company: Znuny Inc.
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
OTRS 5/6 CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Do you need professional services for the ((OTRS)) Community Edition? Check out https://www.znuny.com/

PhyrePhoX
OTRS advanced
Posts: 107
Joined: 05 Dec 2007, 10:56
OTRS 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)

root
Moderator
Posts: 2224
Joined: 18 Dec 2007, 12:23
OTRS Version?: 4/5/6
Real Name: Roy Kaldung
Company: Znuny Inc.
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
OTRS 5/6 CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Do you need professional services for the ((OTRS)) Community Edition? Check out https://www.znuny.com/

PhyrePhoX
OTRS advanced
Posts: 107
Joined: 05 Dec 2007, 10:56
OTRS 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)

Post Reply