Skip to content

Commit

Permalink
Add reference about date searching to Query Builder POD
Browse files Browse the repository at this point in the history
Add reference about general date searching with absolute dates and
also relative dates to Query Builder POD with a few examples.
  • Loading branch information
richieri-bps committed Nov 22, 2023
1 parent 464dacd commit 08e134d
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions docs/query_builder.pod
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,72 @@ tickets the transactions should be on. In our example, we probably only want
to see active tickets, so in the bottom Ticket Fields section you can select
Status "is" and "Active". This will then filter out inactive statuses.

=head1 Searching on Date fields

Searching tickets based on when they were created, resolved, or last updated
is a common use case.

You can easily search tickets by date fields using RT query builder. Simply
pick the Date or DateTime field you want to search on and then choose one
of the comparison operators ("before", "on" and "after"). You can then click
on the value field and pick a date from the calendar that pops up.

For example, if you want to search for tickets created on a specific date,
such as January 30, 2019, you can use the following search criteria:

Field: Created
Operator: on
Value: 2019-01-30

For searching tickets created before a specific date, you can use the
following search criteria:

Field: Created
Operator: before
Value: 2019-01-30

And you can combine two criteria to search for tickets created between
two dates:

Field: Created
Operator: after
Value: 2019-01-01

Field: Created
Operator: before
Value: 2019-01-30

=head2 Relative Dates

Alternatively, you can also build search templates with relative dates
such as "today", "yesterday", "tomorrow", "last week", "next month", and
even more complex dates such as "beginning of last month".

To use relative dates, you can type them directly into the value field
of the search builder.

For example, if you want to search for tickets created during the current
week, you can use the following search criteria:

Field: Created
Operator: after
Value: last Sunday

Another helpful example is to search for tickets resolved during the last
month. You can use 2 criteria to do that:

Field: Resolved
Operator: after
Value: beginning of last month

Field: Resolved
Operator: before
Value: this month

You can check all compatible relative date strings that RT supports at
L<DateTime::Format::Natural::Lang::EN> and L<Time::ParseDate>.


=head1 Advanced

In addition to the graphical query builder, RT also has an Advanced page
Expand Down

0 comments on commit 08e134d

Please sign in to comment.