Timespan as search parameters in URL

Moderator: crythias

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

Timespan as search parameters in URL

Post by PhyrePhoX »

Hi,

i am looking for the exact way to properly add/change search parameters in the url. I dont know why OTRS is making it so hard.
I found out how to use dynamic fields in the search. What i dont know is how to use date or timespan parameters.

Code: Select all

https://otrs.domain.net/otrs/index.pl?Action=AgentTicketSearch;Subaction=Search;ShownAttributes=LabelSearch_DynamicField_ITSMReviewRequired;Search_DynamicField_ITSMReviewRequired=Yes
This link shows me all tickets that have the "ITSMReviewRequired" Dynamic field set to Yes.
I need a link that additionally filters for tickets created in the last 7 days (so, no absolute date values, just the relative period).

Is there a way?

Thanks in advance
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
zzz
Znuny superhero
Posts: 888
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Timespan as search parameters in URL

Post by zzz »

Hey,

Just work with a search profile. After saving it, you can take the 'Profile link' and share it between agents.

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Re: Timespan as search parameters in URL

Post by PhyrePhoX »

zzz wrote: 02 Oct 2019, 12:42 Hey,

Just work with a search profile. After saving it, you can take the 'Profile link' and share it between agents.

Best regards
Emin
Hi, thanks for the reply, but this link only works for ONE agent (the one who creates that search). The Profile link is actually a useless feature (i dont see practical reasons for it). The fact that i cannot generate "public" search profiles is a problem that has been bugging me ever since OTRS 2. So the workaround is to use the URLs where i can add the search params myself. Just need the syntax for the "timespan" operator, though.
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
zzz
Znuny superhero
Posts: 888
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Timespan as search parameters in URL

Post by zzz »

Oh sorry, you're absolutely right! It's been some time since I worked with search profiles and it indeed does not offer a user-friendly experience.

I had to make this up, so I dived into the code; does this one work for you?

Action=AgentTicketSearch;Subaction=Search;TicketCreateTimePoint=7;TicketCreateTimePointFormat=day;TicketCreateTimePointStart=Last;TimeSearchType=TimePoint

Just add your own parameters to it if it does.

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Re: Timespan as search parameters in URL

Post by PhyrePhoX »

that worked perfectly, thank you!

Is there a list of usable search parameters handy somewhere?
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
zzz
Znuny superhero
Posts: 888
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Timespan as search parameters in URL

Post by zzz »

You're welcome.

A list of all search parameters: https://github.com/OTRS/otrs/blob/rel-6 ... ch.pm#L225

Static values for some parameters can be found on line 334 and following.

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Re: Timespan as search parameters in URL

Post by PhyrePhoX »

i asked a followup question in viewtopic.php?f=53&t=41482
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
Post Reply