Re: [rt-users] Default Value for User Custom Fields

2017-03-07 Thread Matt Zagrabelny
On Tue, Mar 7, 2017 at 3:16 AM, Woody - Wild Thing Safaris
 wrote:
> I added "Users" to line 2016 in CustomField.pm
>
> return 0 unless $self->LookupType =~ /RT::(?:Ticket|Transaction|User)$/;
>
> and it seems to behave as expected. But RT::Users must have been left out
> for a reason?

Possibly not.

Here is the commit in which the code was initially committed:

0bb6abb2f4641896d3a77ccca5bb0c3cdc699026

And here is a commit where BP adds Assets to the list of CFs that can
have defaults:

5d851b77f275252578ce29c21a652c88a6663ab6

So I am guessing that it was just an oversight that Users and Queues
aren't in the list of CFs that can have default values.

BP, any commentary on this?

Thanks,

-m
-
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Paris - April 24-26, 2017


Re: [rt-users] Regex in scrip won't match multi-line strings

2017-03-03 Thread Matt Zagrabelny
On Fri, Mar 3, 2017 at 9:30 AM, Peter Nikolaidis  wrote:
> Apparently I'm still doing something wrong and regex is kicking my butt.
>
> Sample message body:
> -
> * Stopping Asterisk PBX: asterisk
> ...done.
> * Starting Asterisk PBX: asterisk
> ...done.
> -
>
> Patterns I've tried:
> -
> 1:
> (($self->TicketObj->Subject =~ /Cron \ \/etc\/init\.d\/asterisk
> restart/) && # Successful cron jobs.
> ($self->TicketObj->Body =~ /\* Starting Asterisk PBX\:
> asterisk\n\.\.\.done\./m)
>
> 2:
> (($self->TicketObj->Subject =~ /Cron \ \/etc\/init\.d\/asterisk
> restart/) && # Successful cron jobs.
> ($self->TicketObj->Body =~ /\* Starting Asterisk PBX\:
> asterisk.*\.\.\.done\./ms))
> 3:
> (($self->TicketObj->Subject =~ /Cron \ \/etc\/init\.d\/asterisk
> restart/) && # Successful cron jobs.
> ($self->TicketObj->Body =~ /^\* Starting Asterisk PBX\:
> asterisk.*\.\.\.done\.$/ms)) ||
> -
>
> Any ideas?

#!/usr/bin/perl

use strict;
use warnings;

my $sample_message_body = <

Re: [rt-users] Default Value for User Custom Fields

2017-03-02 Thread Matt Zagrabelny
What version of RT are you using?

-m

On Thu, Mar 2, 2017 at 1:46 PM, Woody - Wild Thing Safaris
 wrote:
> Hi RT Folks,
>
> Am i missing something? I see no option to select a "default value" for
> "select one value" type custom fields if they are of lookuptype RT::User?
>
> i tested and if it's RT::Ticket - default appears, but RT::User - that input
> field has disappeared?
>
> w.
>
>
> --
>
> ---
>
> Richard Wood (Woody)
> Managing Director
> Wild Thing Safaris Ltd.
>
> UK: 2B Habbo St, Greenwich, London
> Dar es Salaam: 5 Ethan St, Mbezi beach
> Arusha: 3 Ebeneezer Rd, Njiro
> PO BOX 34514 DSM
> Office: +255 (0) 222 617 166
> Office Mobile: +255 (0) 773 503 502
> Direct: +255 742 373 327
> Skype: woody1tz
> http://wildthingsafaris.com
>
> -
> RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
> * Paris - April 24-26, 2017
-
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Paris - April 24-26, 2017


Re: [rt-users] Automatted parsing of mails entering an RT queue

2017-03-02 Thread Matt Zagrabelny
What version are you using CK?

-m

On Thu, Mar 2, 2017 at 2:35 AM, Christopher Kunz  wrote:
> Hi all,
>
> we've been using RT for almost 15 years now with great success, but our
> growing company needs a little more automation now. As we are a hosting
> company /carrier, we frequently receive abuse reports and security
> advisories (for example, automatted scans for UDP amplifiers by the
> German national CERT). These enter our abuse queue.
>
> I would like to parse these mails automatically, and write a parsing
> toolkit for each different type of abuse mail (either by sender, or by
> specific content signature, or something like that), in order to extract
> the affected URIs / IP addresses from the mails and pass them on to an
> abuse handling script for further action.
>
> How would I do that? Are there any articles in the RT wiki that might be
> a good starting point? Unfortunately, the "automating RT" page is more
> about crontool than about the kind of automation I'm looking for.
>
> Thanks a lot,
>
> --ck
> -
> RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
> * Paris - April 24-26, 2017
-
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Paris - April 24-26, 2017


Re: [rt-users] Use lifecycle to set status and invoke Dates page?

2017-02-27 Thread Matt Zagrabelny
On Mon, Feb 27, 2017 at 9:56 AM, Peter Nikolaidis  wrote:
> Hi Matt,
>
> Thanks for the reply. What woudl be the callback/action to take someone to
> the Dates page for a ticket?

Have you used callbacks before? I ask because, while extremely useful,
they also have a learning curve. It helps to know where you are on the
curve.

And the official docs...

https://docs.bestpractical.com/rt/4.4.1/writing_extensions.html#Callbacks
https://docs.bestpractical.com/rt/4.4.1/writing_extensions.html#Adding-and-Modifying-Menus

-m


Re: [rt-users] Regex in scrip won't match multi-line strings

2017-02-27 Thread Matt Zagrabelny
On Mon, Feb 27, 2017 at 9:48 AM, Peter Nikolaidis  wrote:
> Hi all,
>
> I'm trying to automatically resolve tickets that don't require any action.
> In this example, I receive a backup notification. I know it's a backup
> script result email based on the subject, and I know the backup was
> successful (and therefore I can auto-resolve the ticket) if another regex
> matches the body. When I match against the subject line alone, it works.
> However, when I try to match against the mutli-line body, it never matches
> (even though when I run the regex against the string in a test, it matches
> as expected).
>
> Are multi-line matches not an option, or do I need to test in another way?

From:

http://perldoc.perl.org/perlre.html

"""
Modifier m

Treat the string as multiple lines. That is, change "^" and "$" from
matching the start of the string's first line and the end of its last
line to matching the start and end of each line within the string.
"""
I almost always use /xms for my REs. This allows for significant
readability - at the cost of significant number of lines. Check out
Damian Conway's "Perl Best Practices" Regular Expression chapter.

-m


Re: [rt-users] Use lifecycle to set status and invoke Dates page?

2017-02-27 Thread Matt Zagrabelny
Hi Peter,

On Sun, Feb 26, 2017 at 7:59 PM, Peter Nikolaidis  wrote:
> Hi,
>
> I'd like to have a lifecycle action called "schedule," which would set the
> ticket's status to "scheduled" and take the user to the ticket's Dates page
> so they could set a due date. It's this possible?

Just for clarity, the action isn't necessarily lifecycle related - it
certainly could be, though. Statuses are a component of lifecyles,
though.

You can tweak the Actions menu to your desires. We do all sorts of
modifications. There are Menu callbacks to inject your local tweaks
into the Actions menu.

-m


Re: [rt-users] Action mene history blank

2017-02-24 Thread Matt Zagrabelny
Hi Chris,

On Fri, Feb 24, 2017 at 11:27 AM, Chris Willard  wrote:
> Hello Rt-users,
>
> When I reply using the action menu the history is empty! Is this a bug
> and is there a fix?

So we are on the same page:

reply = correspondence (this is part of RT, there is a dual name for a
"public" reply vs a private one (comment)).

To answer your question: Nope. Not a bug. A "reply" (from the Actions
menu) is a new message for the ticket history. You can reply to any
transaction (correspondence or comment) in the ticket display and get
that txn's contents quoted in your reply - so it looks like a reply to
an email. If you only ever reply via the ticket history of txns, then
your replies will always have the history quoted in the contents.

-m


Re: [rt-users] The default queue via RT

2017-02-19 Thread Matt Zagrabelny
Hi Chris,

On Sun, Feb 19, 2017 at 2:19 PM, Chris Willard  wrote:
> Hello All,
>
> Is  it  possible  to  change  the email from address (e.g. The default
> queue via RT)?

What version of RT are you using?

For recent versions:

Admin -> Queues -> Select

Then select the queue that corresponds to the queue that the ticket is in.

Under Basics, edit the Description.

-m


Re: [rt-users] Recovering Disabled Articles

2017-02-14 Thread Matt Zagrabelny
On Tue, Feb 14, 2017 at 8:14 AM, Matthew Coons  wrote:
> Hello RT User group,
>
> I'm curious if there is a way from RT to enable an article that has been
> disabled? I don't see a way to search for disabled articles in RT, and
> Googling this question does not return any helpful ideas.
>
> Thoughts?

What version of RT are you using?

We're on 4.2.11 and there is no disable option for articles - only
delete. And it does delete. I checked the database before and after
clicking the delete link. Afterwards, it is gone.

-m


Re: [rt-users] Fwd: Using getting stuck when choosing new Custom Lifecycle

2017-02-14 Thread Matt Zagrabelny
On Tue, Feb 14, 2017 at 8:14 AM, Dippery, Kyle  wrote:
> In my own custom lifecycle, I have one hyphenated status ("in-use").  I don't 
> remember why (perhaps this is the reason), but I have it in quotation marks 
> as a key in our transitions array:
>
>  transitions => {
>...
>"in-use"  => [qw(allocated recycled stolen lost deleted surplussed 
> destroyed-for-parts scattered-across-the-desert)],
> }
>
> Your hyphenated ones aren't quoted in your array.  Perhaps that's the 
> sticking point?  Perl might be trying to do math with the "-" before 
> assigning to it.

Guaranteed. You need to quote hash keys that contain hyphens.

-m


Re: [rt-users] Assets Advanced Search

2017-02-13 Thread Matt Zagrabelny
Which version of RT are you using?

-m

On Sun, Feb 12, 2017 at 4:09 PM, Chris McClement  wrote:
> Is there a way of "advanced searching" assets? For example, I'd like to
> search for all assets where status != "EOL" etc. When searching tickets
> there's always an advanced tab where I can manually edit the search string
> but I'm unable to find this with assets.


Re: [rt-users] Tickets time affected on service contrats

2017-02-09 Thread Matt Zagrabelny
On Thu, Feb 9, 2017 at 7:35 AM, Frank Soyer  wrote:
> I tried, thanks for the suggestion Matt. But if I need to dig in code to
> have a sum of times, I think I'll rather try to develop a module to manage
> contracts ^^
> Unfortunatly, no time to learn RT dev for the moment, and no time to dev...
> If I start such a project, I'll share it.

Hey Frank,

FWIW, you could ask Best Practical for a quote on this. It doesn't
sound like too much work. It might not be too expensive.

-m


Re: [rt-users] excluding queue in RT SQL

2017-02-09 Thread Matt Zagrabelny
Hey Alex,

On Thu, Feb 9, 2017 at 9:02 AM, Alex Hall  wrote:
> Hi all,
> Just a quick question, and one I feel like I should know. In RT's
> implementation of SQL, how do I specify a queue; name or ID?

Just a point of clarification: RT has something called TicketSQL and
while "SQL" is in its name, it is not SQL.

That being said, you want the queue's name.

> We have a cron job that runs, using SQL to search for tickets. I'm being
> asked to exclude a specific queue from this search. Do I need to use "queue
> <> 'queue name'" or "queue <> 7"? Thanks.

I would build some of the query with the search builder:

Search -> Tickets -> New Search

Add a few predicates to your search and then click Advanced. You'll
see exactly what TicketSQL RT uses.

-m


Re: [rt-users] Unable to bulk update Assets

2017-02-08 Thread Matt Zagrabelny
On Wed, Feb 8, 2017 at 2:58 PM, Shawn M Moore  wrote:

> We have a fix for this in the upcoming releases of RT; in the meantime you
> can apply the patch to your RT instance:

Shawn,

Any rough estimate on 4.4.2?

Thanks!

-m


Re: [rt-users] Tickets time affected on service contrats

2017-02-08 Thread Matt Zagrabelny
Hi Frank,

On Wed, Feb 8, 2017 at 4:11 AM, Frank Soyer  wrote:
> Hi all,
> I wonder if an extension or some solution exists for managing service
> contracts, I mean, registering somewhere for a queue and/or a (some)
> requestor(s), a total time to decrement, and decrementing it with the time
> spent on tickets of this resquestor(s). Or, at least, report on demand the
> time spent for this requestor(s).

You could set up a "master" ticket and link in the child tickets to
it. I'm not aware of any built in mechanisms that will adjust time
accordingly between parent and child tickets - but you could certainly
add in some code to do that.

-m


Re: [rt-users] Changing default format of ticket list in queue?

2017-01-30 Thread Matt Zagrabelny
Hi Alex,

On Mon, Jan 30, 2017 at 11:18 AM, Alex Hall  wrote:
> Hi all,
> Where would I go to change the default format for the list of tickets shown
> when you click a queue name?

I presume you are talking about the Queue List?

 Can this be done on a queue-by-queue basis, or
> only as a modification to some template in share/html?

I don't think there is anything out of the box that will do what you
want. That being said, we use a callback to tweak the output for just
a single queue.

Note: the path may be different for the callback file location due to
us running 4.2.

# cat 
/opt/rt4/local/plugins/RT-Site-UMN-Duluth-QueueListTweaks/html/Callbacks/RT-Site-UMN-Duluth-QueueListTweaks/Elements/QueueSummaryByLifecycle/LinkBuilders
<%INIT>
my $umd_link_all = sub {
my ($queue, $all_statuses) = @_;
my @escaped = @{$all_statuses};

# People want to see resolved tickets in the calendar view
# of their QueueList - that is, for the Computer Management (CM) queue.
# Aside from this "if" statement, this sub routine was lifted from
# upstream's version.
if ($queue->{Name} eq 'CM') {
push @escaped, 'resolved';
}

s{(['\\])}{\\$1}g for @escaped; #'# help out the syntax highlighting

my $search = ${$build_search_link}->(
$queue->{Name},
"(".join(" OR ", map "Status = '$_'", @escaped).")",
);

if ($queue->{Name} eq 'CM') {
my @fields = map
{ "'__${_}__'" }
(
'Created',
'Due',
'Resolved',
'Started',
'Starts',
'LastUpdated',
)
;

my $format = $m->interp->apply_escapes(
join(',', @fields),
'u',
);
$search .= '='.$format;
}

return $search;
};

${$link_all} = $umd_link_all;

<%ARGS>
$build_search_link
$link_all
$link_status


Enjoy,

-m


Re: [rt-users] Hiding menu options for particular user groups

2017-01-25 Thread Matt Zagrabelny
On Wed, Jan 25, 2017 at 3:03 PM, Matthew Coons  wrote:
> Is there anything besides restarting apache and clearing the Mason cache
> that I need to do for my changes to take effect?

Perhaps. What did you exactly do besides those two steps? Feel free to
copy and paste what commandline commands you ran.

> I found the callbacks that reference the "logout" button in the "Tabs" file
> and I commented them out.

Ideally you should be using the callback, not commenting it out.

> I restarted apache and cleared the mason cache, but I still see the logout
> option present. Even if I start a new session from a private webpage.
>
> Any ideas what I may be doing wrong?

Customizing RT can have a bit of a learning curve, but once you
understand the details, it is rather flexible and powerful.

All that being said, if this is your first customization, it might
take a few iterations before things start clicking.

-m


Re: [rt-users] Hiding menu options for particular user groups

2017-01-25 Thread Matt Zagrabelny
https://docs.bestpractical.com/rt/4.4.1/writing_extensions.html#Adding-and-Modifying-Menus

On Wed, Jan 25, 2017 at 11:57 AM, Matthew Coons  wrote:
> Hello RT users,
>
> I wanted to know if anybody had a working example or was already hiding RT
> menu options from logged in users?
>
> The first item I want to hide is the "Logout" button for all users. We're
> using SSO so it's not required to be present.
>
> The second item I would like to hide (for a specific user group) is the RTIR
> menu option.
>
> Any help or suggestions would be much appreciated,
>
> Thank you!
>
> Matt Coons
>


Re: [rt-users] Limiting rt-crontool notifications to every n days?

2017-01-17 Thread Matt Zagrabelny
On Tue, Jan 17, 2017 at 1:24 PM, Alex Hall  wrote:
>  Did your JSON-like syntax for
> updating fields ever make it into core for 4.4.1?

Not yet.

-m


Re: [rt-users] Limiting rt-crontool notifications to every n days?

2017-01-17 Thread Matt Zagrabelny
Just download the .bin and move it into
/opt/rt4/lib/RT/Action/ModifyCustomField.pm

-m

On Tue, Jan 17, 2017 at 1:24 PM, Alex Hall <ah...@autodist.com> wrote:
> Thank you, that looks like it'll work. Did your JSON-like syntax for
> updating fields ever make it into core for 4.4.1? I found the attachment in
> your linked message, but it's a bin file and I'm not sure what to do with
> it.
>
> On Tue, Jan 17, 2017 at 11:17 AM, Matt Zagrabelny <mzagr...@d.umn.edu>
> wrote:
>>
>> Hey Alex,
>>
>> On Mon, Jan 16, 2017 at 8:18 AM, Alex Hall <ah...@autodist.com> wrote:
>> > Hi all,
>> > RT is sending out notifications for old tickets just like we want it to.
>> > If
>> > a ticket hasn't been updated in seven days and the status is open or
>> > new,
>> > the owner gets an email every weekday until the ticket is updated. What
>> > I'd
>> > like to do, though, is have a way of changing that "every weekday" bit
>> > for
>> > stalled tickets.
>> >
>> > Instead of warning users every weekday about tickets that are stalled
>> > and
>> > haven't been touched in a while, I'd like to warn them once or twice a
>> > week.
>> > I can't run the cron job that seldom, though, or a ticket could go days
>> > longer than it should without being picked up. Is there any way to only
>> > send
>> > an email to a user if the system has not emailed them in N days? I could
>> > add
>> > a column to the Tickets table for this, or add a new table, but I always
>> > like to stay clear of database schema modifications if I can. Besides, I
>> > don't know how to interface with a custom table using RT SQL.
>>
>> I wouldn't alter the schema.
>>
>> > Is there any way of doing this?
>>
>> You could use a custom field. Something like "Last Email Notification
>> Sent At" or something equally verbose. ;)
>>
>> Then add that CF to your query about which tickets need to get email
>> notifications.
>>
>> We do essentially what you are asking about. We leverage two things:
>>
>> 1. rt-crontool can take multiple --action arguments
>> 2. A custom (but it could be "cored") scrip action. The scrip action
>> is ModifyCustomField. Here is a link to it:
>>
>>
>> http://lists.bestpractical.com/pipermail/rt-devel/2016-December/012601.html
>>
>> Here is one of our cron jobs that keeps track of when it sent an email
>> and also sends the email:
>>
>> 0 12 * * * /opt/rt4/bin/rt-crontool --log=warning --search
>> RT::Search::FromSQL --search-arg ' Queue = "Access Requests" AND
>> Status = "activated" AND ( ( "CF.{Renewal Verified At}" IS NULL AND
>> Created <= "1 year ago" ) OR ( "CF.{Renewal Verified At}" IS NOT NULL
>> AND "CF.{Renewal Verified At}" <= "1 year ago" ) ) AND ( "CF.{Renewal
>> Verification Sent At}" IS NULL OR "CF.{Renewal Verification Sent At}"
>> <= "20 days ago" ) ' --transaction-type Create --transaction last
>> --template "Access Request Renewal Verification" --action
>> RT::Action::MailRequestors --action-arg "" --action
>> RT::Action::ModifyCustomField --action-arg '{ "name": "Renewal
>> Verification Sent At", "operation": "set", "value": "now" }'
>>
>> -m
>
>
>
>
> --
> Alex Hall
> Automatic Distributors, IT department
> ah...@autodist.com


Re: [rt-users] Limiting rt-crontool notifications to every n days?

2017-01-17 Thread Matt Zagrabelny
Hey Alex,

On Mon, Jan 16, 2017 at 8:18 AM, Alex Hall  wrote:
> Hi all,
> RT is sending out notifications for old tickets just like we want it to. If
> a ticket hasn't been updated in seven days and the status is open or new,
> the owner gets an email every weekday until the ticket is updated. What I'd
> like to do, though, is have a way of changing that "every weekday" bit for
> stalled tickets.
>
> Instead of warning users every weekday about tickets that are stalled and
> haven't been touched in a while, I'd like to warn them once or twice a week.
> I can't run the cron job that seldom, though, or a ticket could go days
> longer than it should without being picked up. Is there any way to only send
> an email to a user if the system has not emailed them in N days? I could add
> a column to the Tickets table for this, or add a new table, but I always
> like to stay clear of database schema modifications if I can. Besides, I
> don't know how to interface with a custom table using RT SQL.

I wouldn't alter the schema.

> Is there any way of doing this?

You could use a custom field. Something like "Last Email Notification
Sent At" or something equally verbose. ;)

Then add that CF to your query about which tickets need to get email
notifications.

We do essentially what you are asking about. We leverage two things:

1. rt-crontool can take multiple --action arguments
2. A custom (but it could be "cored") scrip action. The scrip action
is ModifyCustomField. Here is a link to it:

http://lists.bestpractical.com/pipermail/rt-devel/2016-December/012601.html

Here is one of our cron jobs that keeps track of when it sent an email
and also sends the email:

0 12 * * * /opt/rt4/bin/rt-crontool --log=warning --search
RT::Search::FromSQL --search-arg ' Queue = "Access Requests" AND
Status = "activated" AND ( ( "CF.{Renewal Verified At}" IS NULL AND
Created <= "1 year ago" ) OR ( "CF.{Renewal Verified At}" IS NOT NULL
AND "CF.{Renewal Verified At}" <= "1 year ago" ) ) AND ( "CF.{Renewal
Verification Sent At}" IS NULL OR "CF.{Renewal Verification Sent At}"
<= "20 days ago" ) ' --transaction-type Create --transaction last
--template "Access Request Renewal Verification" --action
RT::Action::MailRequestors --action-arg "" --action
RT::Action::ModifyCustomField --action-arg '{ "name": "Renewal
Verification Sent At", "operation": "set", "value": "now" }'

-m


Re: [rt-users] __active__ including stalled tickets?

2017-01-05 Thread Matt Zagrabelny
...and I see that Shawn has answered, too. Here is what I had to say:

"stalled" is an active status. I know the word feels "inactive", but
according to the default lifecycle, it is active.

https://github.com/bestpractical/rt/blob/stable/etc/RT_Config.pm.in#L3034

On Thu, Jan 5, 2017 at 10:07 AM, Alex Hall <ah...@autodist.com> wrote:
>
>
> On Thu, Jan 5, 2017 at 11:01 AM, Matt Zagrabelny <mzagr...@d.umn.edu> wrote:
>>
>> __Active__ is case sensitive, I believe.
>
>  I should have said that I tried capital and lowercase A in my searches,
> along with making the word all caps. I keep getting the same result.
>
>>
>> -m
>>
>> On Thu, Jan 5, 2017 at 9:56 AM, Alex Hall <ah...@autodist.com> wrote:
>> > Hey all,
>> > I just did a search:
>> > Priority > 9 and Status = '__active__'
>> > Five of the resulting tickets are stalled, but I thought __active__
>> > ignored
>> > stalled tickets. Any idea why they're appearing? Did I miss a setting or
>> > something, or is this intended behavior? Thanks.
>> > --
>> > Alex Hall
>> > Automatic Distributors, IT department
>> > ah...@autodist.com
>
>
>
>
> --
> Alex Hall
> Automatic Distributors, IT department
> ah...@autodist.com


Re: [rt-users] no alert for invalid mail addresses

2017-01-05 Thread Matt Zagrabelny
On Thu, Jan 5, 2017 at 9:59 AM, Petr Hanousek  wrote:
> Thank you Matt, this will also help. BTW, for the curiosity, the "Merge
> with an alternate user" option behaves the same way like
> http://search.cpan.org/~bps/RT-Extension-MergeUsers/lib/RT/Extension/MergeUsers.pm
> or does it have some extra functionality?

No extra functionality. In fact the module in question depends on the
MergeUsers module.

-m


Re: [rt-users] __active__ including stalled tickets?

2017-01-05 Thread Matt Zagrabelny
__Active__ is case sensitive, I believe.

-m

On Thu, Jan 5, 2017 at 9:56 AM, Alex Hall  wrote:
> Hey all,
> I just did a search:
> Priority > 9 and Status = '__active__'
> Five of the resulting tickets are stalled, but I thought __active__ ignored
> stalled tickets. Any idea why they're appearing? Did I miss a setting or
> something, or is this intended behavior? Thanks.
> --
> Alex Hall
> Automatic Distributors, IT department
> ah...@autodist.com


Re: [rt-users] no alert for invalid mail addresses

2017-01-05 Thread Matt Zagrabelny
Hi Petr,

We have this problem a lot.

BP wrote us this module to help manage autocreated users that don't
belong in the database:

https://github.com/bestpractical/rt-extension-manageautocreatedusers

-m

On Thu, Jan 5, 2017 at 3:53 AM, Petr Hanousek  wrote:
> Hi geeks,
> sometimes someone here mistypes the mail address of Requestor or CC. The
> typos in addresses are various, my question is about the really obvious
> ones. Like if you put to CC an address "a@b". Is there any mechanism in
> RT to detect such mistakes and say something at least? Or can I have a
> feature request for this? :)
>
> If you try this in Gmail or Thunderbird, an error is raised and the
> message is not sent.
>
> Thank you, Petr
>
> --
> +---+
>Petr Hanousek   e-mail: petr.hanou...@cesnet.cz
>MetaCentrum User Supportphone: +420 950 072 112
>CESNET z.s.p.o. mobile: +420 606 665 139
>location: Zikova 13a, Praha room: 32b
> Czech Republic
> +---+


Re: [rt-users] Where to put crontool scripts?

2017-01-04 Thread Matt Zagrabelny
On Wed, Jan 4, 2017 at 10:13 AM, Alex Hall  wrote:
> Hi all,
> I'm just wondering if there's a conventional place to store scripts that run
> crontool jobs? I've got one to notify people of old tickets, but I'll be
> making more, now that this one is working. Thanks again for all the help
> with that script, by the way.

We just have the whole script in the crontab:

% sudo crontab -l -u rtcrontool
[...]
15 8-16 * * 1-5 /opt/rt4/bin/rt-crontool --log=warning --search
RT::Search::FromSQL --search-arg ' Queue = "Systems" AND Owner =
"Nobody" AND ( Status = "new" OR Status = "open" ) AND ( Starts IS
NULL OR Starts <= "now" ) ' --condition
RT::Condition::CreatedBusinessHoursAgo --condition-arg 4 --action
RT::Action::MailAdminCcs --transaction-type Create --transaction last
--template "Unowned Ticket"
[...]

-m


Re: [rt-users] How to create a new RoleGroup?

2017-01-04 Thread Matt Zagrabelny
On Wed, Jan 4, 2017 at 8:30 AM,   wrote:

> I logged into RT as an admin:
> -> Admin -> Queues -> Select Queue -> Watchers
>
> Then:
> - New Watcher ->  Find NAME -> Choose Option "AdminCc" --> Save Changes
> ERROR: Role group 'AdminCc' not found

I just ran a quick test and it works for me with 4.2.11.

> The Debug-Log says:
>
> "[7814] [Wed Jan  4 14:28:00 2017] [warning]: Use of uninitialized value in
> join or string at /usr/share/perl5/DBIx/SearchBuilder.pm line 1087, 
> line 1662. (/usr/share/perl5/DBIx/SearchBuilder.pm:1087)
> [7814] [Wed Jan  4 14:28:00 2017] [warning]: DBD::Pg::st execute failed:
> FEHLER:  Syntaxfehler bei »)«
> LINE 1: ...nt(main.id) FROM GroupMembers main  WHERE (main.GroupId = )
>  ^ at
> /usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 586,  line 1662.
> (/usr/share/perl5/DBIx/SearchBuilder/Handle.pm:586)

Looking at the above SQL error it looks lie there is no main.GroupId
in the query. The formatting of the email causes the caret (^)
indicator to not point at the right error.

What would cause the GroupId to be scrubbed?

Do you have some custom JS or any Overlays or Callbacks that would interfere?

-m


Re: [rt-users] How to create a new RoleGroup?

2017-01-04 Thread Matt Zagrabelny
Hi Patrick,

On Wed, Jan 4, 2017 at 8:00 AM,   wrote:
>
> Hello,
>
> after an RT-Upgrade I am not able to add Watchers to on Queue.

What version were you running?

What version did you upgrade to?

> Error Message:  In german "Rollen Gruppe 'AdminCc' nicht gefunden"
> In English something like "Role Group 'AdminCc' not found"

What actions did you take to generate this error? Please be specific.

Thanks!

-m


Re: [rt-users] external templates

2016-12-19 Thread Matt Zagrabelny
Hey Woody,

I haven't encountered external templates. Obviously, anything is
possible - but I don't know the best solution for your problem.

-m

On Mon, Dec 19, 2016 at 11:14 AM, Woody - Wild Thing Safaris
 wrote:
> Hi All,
>
> I've searched long and hard, but to my surprise not found anything that
> relates to external templates - maybe it's so trivially obvious that the
> question is a non question, but i have to ask it.
>
> i have externalised customfields, conditions, actions etc. but templates,
> especially those containing perl code are still in a textarea input box.
>
> what would anyone recommend as a solution to this.
>
> I'm almost expecting a one-liner like:
>
> { import Templates/MyTemplate }
>
> if import were such a concept in perl
>
> thanks in advance
>
> Woody.
>
>
> --
>
> ---
>
> Richard Wood (Woody)
> Managing Director
> Wild Thing Safaris Ltd.
>
> UK: 2B Habbo St, Greenwich, London
> Dar es Salaam: 5 Ethan St, Mbezi beach
> Arusha: 3 Ebeneezer Rd, Njiro
> PO BOX 34514 DSM
> Office: +255 (0) 222 617 166
> Office Mobile: +255 (0) 773 503 502
> Direct: +255 742 373 327
> Skype: woody1tz
> http://wildthingsafaris.com
>


Re: [rt-users] constantly seeing error after RT::Extension::Announce

2016-12-19 Thread Matt Zagrabelny
Hi Alex,

On Mon, Dec 19, 2016 at 12:07 PM, Alex Hall  wrote:
> I'm almost positive I ran that, and the page says I could end up with data
> duplication if I run it again. Is there a query I could run in the database
> to check, so I can know for sure? Thanks.

Check the initialdata file for the extension to see what it is
creating in the database. You can definitely query the database.
Perhaps start with the customfields table.

-m


Re: [rt-users] LastUpdated for tickets not working?

2016-12-19 Thread Matt Zagrabelny
Hi Alex,

On Mon, Dec 19, 2016 at 12:54 PM, Alex Hall  wrote:
> Hello all,
> I'm trying to get stale ticket alerts working, so am using the
> UntouchedInHours condition. I've also tried, in SQL:
> LastUpdated <= '2 days ago'
> and similar searches. Yet, I always get the same number of tickets as I get
> when I leave the date restriction off completely, and UntouchedInHours is
> always giving me tickets opened today.

I assume you are using rtcrontool. Correct?

How are you alerting?

Is the alerting actually "touching" the tickets thus affecting the query?

You can query the tickets table directly and see the lastupdated
field. See if that field changes how you would expect when you "touch"
or "update" a ticket.

-m


Re: [rt-users] All users can comment despite that right being revoked

2016-12-15 Thread Matt Zagrabelny
On Thu, Dec 15, 2016 at 11:08 AM, Alex Hall  wrote:

> You mentioned a rights debugger in 4.6. Is 4.6 out for testing?

Not yet.

 Rights
> debugging sounds very useful!

My employer is sponsoring the rights debugger. BP said it would be
cored in 4.6 or 4.8.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017


Re: [rt-users] All users can comment despite that right being revoked

2016-12-15 Thread Matt Zagrabelny
Hi Alex,

On Thu, Dec 15, 2016 at 8:28 AM, Alex Hall  wrote:
> Hi all,
> We've just discovered something odd. It seems that all users can comment on
> tickets, even though we've removed the "comment on tickets" right everywhere
> we've found it--all groups, privileged users, everyone, etc. I could simply
> remove the comment action from the actions list, but I'd rather find out why
> the right revoking isn't doing what I thought.
>
> Is there a way to search the RT database to see where this right is enabled,
> to check that none of us (admins) missed it somewhere? Is there a second
> right that might cause this action to appear, that isn't called "comment on
> tickets"? Maybe we've just overlooked something seemingly not important but
> that actually causes commenting to be granted?
>
> To clarify my "search the database" question: I know SQL and how to query
> the RT database. I just don't know which tables or columns to include, or
> what value to look for. Thanks.

Have you checked your global rights?

Admin -> Global -> Groups

PS. There might be a rights debugger in 4.6.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017


Re: [rt-users] Count and Group By CF

2016-12-09 Thread Matt Zagrabelny
On Fri, Dec 9, 2016 at 11:23 AM, Barton Chittenden
 wrote:
> We use a CF called 'Community Bug' to track bugzilla bug numbers associated
> with customer tickets. It would be really useful to know which values of
> CF.{Community Bug} occur most often.
>
> If you'll pardon a mix of SQL and query builder syntax, I'm looking to do
> something like this:
>
> SELECT COUNT(*), CF.{Community Bug}
> FROM CF
> GROUP BY CF.{Community Bug}
> ORDER BY COUNT(*)
>
> I'm well aware that query builder doesn't work like this, but I'm wondering
> if there's a way to do something like this.

What RT are you using?

In 4.2 the defaults will get you mostly there.

Search -> Chart

Group by -> Custom field

Choose CF, then "Update Chart"

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017


Re: [rt-users] missing callbacks in 4.4.1 CSS?

2016-12-09 Thread Matt Zagrabelny
Hey Alex,

On Fri, Dec 9, 2016 at 10:08 AM, Alex Hall  wrote:
> Thanks. By "lib", I assume you just mean to make a folder somewhere, then
> use "@import myNewLib/myFile.css"? Should I make a replacement for the css
> file in local/html/NoAut/something that I'm replacing? I actually don't see
> a static folder around this CSS folder, so I'm not quite sure what should go
> where.h

The static directory would be in your extension file hierarchy.

You'll be doing yourself a favor to be making most of your
customizations by ways of your own site modules (or extension).

Here is the documentation link for including your own static files:

https://docs.bestpractical.com/rt/4.4.1/writing_extensions.html#CSS-and-Javascript

Since you're using Debian the Perl modules for creating RT modules
should be in APT. I'd move forward with Module::Install::RTx.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017


Re: [rt-users] missing callbacks in 4.4.1 CSS?

2016-12-09 Thread Matt Zagrabelny
Hi Alex,

No need for a callback. Just include your CSS files in a lib. There is a
function call you can make to include a CSS file in /static/css/. This is
the proper way in, at least, 4.2.

-m

On Dec 9, 2016 9:55 AM, "Alex Hall"  wrote:

> Hey all,
> I'm trying to add a background image to a div, so went looking for the
> callback the wiki describes. The wiki uses 3.8, and I'm on 4.4.1, but I
> didn't think that mattered. Yet, I can't find any callbacks by looking in
> main.css or base.css, and the wiki's big list of 4.2 callbacks has no css
> at all. I tried
> cd /opt/rt4/share
> find /static/css | xargs grep 'callback'
>
> as well as
>
> find /static/css -name '*.css' | xargs grep 'callback'
>
> but got no results either way. What's the trick to callbacks in 4.4 for
> CSS? Or do I make a copy of one of the CSS files in /opt/rt4/local and
> modify it? Thanks.
>
> --
> Alex Hall
> Automatic Distributors, IT department
> ah...@autodist.com
>
> -
> RT 4.4 and RTIR training sessions, and a new workshop day!
> https://bestpractical.com/training
> * Los Angeles - January 9-11 2017
>
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017

Re: [rt-users] Searching for tickets with empty CF in RT 4.2.8

2016-12-09 Thread Matt Zagrabelny
Hi Thomas,

On Fri, Dec 9, 2016 at 4:53 AM, Thomas Oddsund
 wrote:
> Hello,
>
> I have some saved searches on my dashboard. Three of them are based on a 
> Custom Field; one show tickets where the CF is set to X, one where CF is set 
> to Y, and one is supposed to show tickets tagged with something other then X 
> or Y.
> To make the third search, I created the following search;
> Queue = 'foo'
> AND CF.{bar} != 'X'
> AND CF.[bar] != 'Y'
> AND (
>   Status = 'new'
>  OR Status = 'open'
>  OR Status = 'stalled' )
>
> However, tickets marked with either X or Y are still appearing in the result. 
> The same result was returned if i changed != to "NOT LIKE", and if I removed 
> either the X or Y part.
>
> Is this a bug, is there something wrong with our RT instance or is there 
> something I've overlooked?

I'm not sure about answering this question, but you can search for
tickets with empty CF values using the Advanced editing option of a
Search:

'CF.{bar}' is null

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017


Re: [rt-users] simple search not finding words in subjects?

2016-11-30 Thread Matt Zagrabelny
On Wed, Nov 30, 2016 at 9:46 AM, Alex Hall  wrote:
> Hi all,
> My boss said he couldn't find a ticket that he thought he should be able to
> find. He was searching a customer name, let's say Custname. I thought at
> first the problem was that the ticket was resolved, but I was wrong.
>
> The problem appears to be that simple search is looking for "content like
> "searchTerm"". When I changed it to "subject like "searchTerm"", the ticket
> in question came right up.
>
> I guess I need to set simple search to look for "content like "searchTerm"
> OR subject like "searchTerm"". But I see no way to customize the simple
> search query in the configuration options. Is this possible?

Yes.

 If so, what's
> the recommended way?

Use a callback. In fact, use this one:

Search/Simple.html/ModifyQuery

I don't see us using this callback in our current RT installation, but
here is the contents of our callback for our legacy (3.8) install. It
doesn't do what you are asking about, but it should give you a feel
for the callback.

cat 
/usr/local/share/request-tracker3.8/plugins/RT-Site-UMN-Duluth/html/Callbacks/RT-Site-UMN-Duluth/Search/Simple.html/ModifyQuery
<%INIT>
my %statuses;
if (RT->Config->Get("ActiveStatus")) {
  %statuses = map { $_ => 1 } RT->Config->Get("ActiveStatus"); # Put
active statuses into our hash
}
if (RT->Config->Get("InactiveStatus")) {
  %statuses = (map({ $_ => 1 } RT->Config->Get("InactiveStatus")),
%statuses); # Put inactive statuses into our hash
}

my $all_statuses = join "|", keys %statuses;

delete $statuses{rejected};
delete $statuses{deleted};
my $statuses_we_care_about = join " ", keys %statuses;
# if 'query' does not have a status word in the query or is not
strictly a number
# then prepend some statuses to the query
if ($$query !~ /\b(?:$all_statuses)\b|^\s*\d+\s*$/i ) {
   $$query = "$statuses_we_care_about $$query";
}

<%ARGS>
$query => undef


-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017


Re: [rt-users] Custom fields in saved searches

2016-11-30 Thread Matt Zagrabelny
Hi Alex,

On Wed, Nov 30, 2016 at 8:05 AM, Alex Hall  wrote:
> Hi all,
> We have one global custom field, 'type', and several other custom fields
> that only apply to one queue. When we make a saved search for our sales reps
> so they can see tickets that apply to the customers they manage, we can't
> include any custom fields in the criteria or display except 'type'. I know
> this is because the other fields aren't global, but how do we get RT to
> include these fields? These reps all have access to the queue to which the
> fields belong, so I'm not sure why they (the fields) won't show up anywhere
> in the search builder interface. I can't even write them in, although given
> how many different ways there seem to be to write in a CF, I could just be
> doing it wrong. Thanks for any suggestions.

The per-queue CFs will show up, in the Search Builder interface, once
you restrict your query to that queue - ie. add a Queue is "Blah"
predicate.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017


Re: [rt-users] Exporting Data From RT

2016-11-23 Thread Matt Zagrabelny
Hey Eddie,

You can get spreadsheet (TSV) representation of ticket search results -
which could include CFs. I'm not sure about the transaction (txn) history.

Perhaps via REST?

I'm guessing that there isn't an *easy* way to get all that.

-m

On Wed, Nov 23, 2016 at 9:05 AM, Eddie Jones 
wrote:

> *From:* Eddie Jones [mailto:ejo...@eastontelecom.com]
> *Sent:* Wednesday, November 23, 2016 9:55 AM
> *To:* 'rt-users@lists.bestpractical.com'
> *Subject:* Exporting Data From RT
>
>
>
> Hello,
>
>
>
> I need to export data from RT, including all ticket information (comments,
> custom field values, etc.).  Is there an easy way to do that?
>
>
>
> Thanks,
>
>
>
> Eddie Jones
>
> Systems Administrator
>
> Easton Telecom Services
>
> www.eastontelecom.com
>
> 330-659-6700  x234
>
>
>
> [image: logo]
>
>
>
> -
> RT 4.4 and RTIR training sessions, and a new workshop day!
> https://bestpractical.com/training
> * Los Angeles - January 9-11 2017
>
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017

Re: [rt-users] Failed attempt to create a ticket by email, from us-c...@ncas.us-cert.gov

2016-11-21 Thread Matt Zagrabelny
Hi Steve,

Try granting "View queue" to everyone.

-m

On Mon, Nov 21, 2016 at 2:34 PM, Stephen Switzer  wrote:

> I received an email today:
>
> us-c...@ncas.us-cert.gov attempted to create a ticket via email in the queue 
> Incident Reports; you
> might need to grant 'Everyone' the CreateTicket right.
>
>
> Yet, I've double checked the permissions:
>
>
>
> I have both items checked for Privileged an Unprivileged as well.
> "us-c...@ncas.us-cert.gov"  doesn't exist in
> the system as a user (yet). What am I missing?
>
> --
>
> Best regards,
> Steve
>
> -
> RT 4.4 and RTIR training sessions, and a new workshop day!
> https://bestpractical.com/training
> * Los Angeles - January 9-11 2017
>
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017

Re: [rt-users] questions about crontool user setup

2016-11-17 Thread Matt Zagrabelny
On Thu, Nov 17, 2016 at 10:45 AM, Alex Hall  wrote:
> Hi list,
> I'm looking into email alerts for untouched tickets, and I thought of the
> crontool right away. In reading its Wiki page, I'm a little confused about
> setting up the user to run it. RT 4.4.1, Debian 8. Link I've been reading:
> https://rt-wiki.bestpractical.com/wiki/UseRtCrontool
>
> The page says to make an RT user *and* a Unix user.

Correct.

 If the tool runs on the
> server, though, where does the RT user come into it?

The RT is pertinent because while the shell account can execute
programs on the system, the RT database only knows of users that exist
in the database.

Thus, the crontool user (shell account) will change the status, or
comment, or correspond, or make any other txn, the RT system needs an
"actor" for that txn. So, you need to link the system (shell) account
and the RT (database) account.


 If I do need both a
> Unix and RT user, what do I enter into RT as the user's Unix login value?

We have an RT user named: rtcrontool. We also have a system (shell)
account with the same name.

In the modify page for the user, there is a "Unix login" field. Enter
your system (shell) account name there. It happens to be the same in
our situation, but it need not be.

> Can I just make my RT user part of the admin group, or should I *only* grant
> it the two rights the Wiki page mentions (view/modify tickets in all
> queues)?

We do not give the rtcrontool user admin rights.

Our rtcrontool user has the following rights:

comment on tickets
reply to tickets
view custom field values
view queue
view ticket summaries
modify custom field values
modify tickets
view scrip templates

It has been many years since we installed RT and our rtcrontool user
does many different things. That said, I'm not sure if all the above
rights are needed/correct for our environment.

 That is, do I need to grant specific user rights, because of
> security concerns surrounding making this user a full admin, or can I just
> make it an admin?

I would only grant what you need.

Thanks for any explanations.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017


Re: [rt-users] FTS enabled in SiteConfig, but not being enabled

2016-11-15 Thread Matt Zagrabelny
On Tue, Nov 15, 2016 at 9:56 AM, Alex Hall  wrote:
> Good thought, but that doesn't seem to have helped. It still says that
> Enable and Indexed are 0 in the system configuration page.
>
> On Tue, Nov 15, 2016 at 10:49 AM, Martin Wheldon
>  wrote:
>>
>> Hi Alex,
>>
>> Sounds like you may need to clear the mason cache.

Clearing the mason cache only affects mason components that have been
updated on disk.

Changing configuration parameters wouldn't effect any mason components.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017


Re: [rt-users] Unable to create tickets after MySQL update?

2016-11-14 Thread Matt Zagrabelny
Hi Alex,

On Mon, Nov 14, 2016 at 10:37 AM, Alex Hall  wrote:
> Hello again all,
> I just discovered I have a more serious problem than full-text indexing not
> working. I'm getting an error when anyone tries to make a ticket, and the
> ticket is never created. Here's the message:
>
> Nov 14 11:31:03 server24 RT: [2522] DBD::mysql::st execute failed: Incorrect
> integer value: 'ARRAY(0x18325928)' for column 'Priority' at row 1 at
> /usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 586.
>
> I have the PriorityAsString extension installed, but that's been working
> perfectly for weeks. I've also modified some files so that the user can
> select a priority on the main ticket creation page instead of going to the
> details view, but that's also been working smoothly. The only major change
> is the MySQL 5.5 upgrade to 5.7, but why that would be the cause, given the
> error message, I'm not sure. If RT were trying to insert a string like that
> before, it should have never worked. Is there anything I can do to fix this?
> I'd rather not revert to 5.5, because I still want that full-text indexing
> at some point and would rather fix this problem so I can keep trying to do
> that. Thanks!

Some thoughts...

What do your PriorityAsString configs look like?

Try disabling PriorityAsString.

I know it doesn't help where you're at right now, but are you testing
your changes in a test environment before making these changes in
production?

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017


Re: [rt-users] color-coding tickets by priority?

2016-11-07 Thread Matt Zagrabelny
Hi Alex,

On Mon, Nov 7, 2016 at 8:49 AM, Alex Hall  wrote:
> Hi list,
> Now that I have priority on the main ticket creation page rather than the
> details page, people are using it more. I'm expecting the next question I
> get to be about making tickets of certain priorities more visually striking
> in results lists. For instance, if a color is 30-50 (our cap is 50), could
> it be made a different color than the tickets that are 1-29, while tickets
> at 0 are a third color? RT may already do this, I'm not sure, since I use a
> screen reader. If it doesn't, can it be made to?

Here is a link that I used many years ago to get started with custom
styles for ticket search results.

https://rt-wiki.bestpractical.com/wiki/ShowStatusInColor

I took a quick look at our site module (that I based off the above
link) and the key concept is utilizing the ColumnMap, which implies
tweaks to the columns of the resulting ticket listing. I'm not sure if
there is something that equally manipulates the ticket "row". A quick
grep of the source tree for "rowmap" yielded zero results.

 At the least, do tickets
> have a class I could use in CSS to do this?

Have you checked the HTML source of a listing of tickets?

 If not, it would be easy enough
> to add that to the div in the HTML, but before I go making solutions, I
> wanted to see what RT already had in place.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017


Re: [rt-users] Searching ticket content?

2016-11-07 Thread Matt Zagrabelny
Hey Alex,

On Mon, Nov 7, 2016 at 7:57 AM, Alex Hall  wrote:
> Hello list,
> Some users at work are wondering if they can search ticket contents? There's
> no way in the search builder,

E nope. There is.

Search -> Tickets -> New Search

The second drop down on your left starts with "Subject". Change it to "Content".

Do you have fulltext searching enabled?

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017


Re: [rt-users] Overriding files in lib/RT?

2016-10-31 Thread Matt Zagrabelny
Hi Alex,

On Mon, Oct 31, 2016 at 11:09 AM, Alex Hall  wrote:
> Hey list,
> How would I override /opt/rt4/lib/RT/Interface/Email.pm?

Overlays.

https://docs.bestpractical.com/rt/4.4.1/RT/StyleGuide.html#EXTENDING-RT-CLASSES

It looks like there is also an outdated wiki article:

https://rt-wiki.bestpractical.com/wiki/ObjectModel

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - Q1 2017


Re: [rt-users] custom validation on custom fields?

2016-10-28 Thread Matt Zagrabelny
On Fri, Oct 28, 2016 at 3:30 PM, Alex Hall  wrote:
> Indeed there is, and I honestly don't know how I missed it. All I can say is
> I must have tabbed right past it, so the screen reader never spoke the
> field's name.
>
> I noticed the pound sign being used a lot. Is the rule you mentioned in any
> way tied to the field, or is it just an internal note so you know what you
> were doing if you go back later?

Hold

 On a related note, is there a way to give a
> more readable message after the field than
> input must match [complex regex that most users won't understand]

This.

I believe the validation comment is passed back to the end-user when
validation fails:

"Custom Field State must match State Abbreviation." or something on that order.

for (?#State Abbreviation)^[A-Z][A-Z]$

FWIW, I am not sure if I've ever used the validation field of a CF. I
did have  a conversation with Best Practical about it once, though.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - Q1 2017


Re: [rt-users] custom validation on custom fields?

2016-10-28 Thread Matt Zagrabelny
Hey Alex,

On Fri, Oct 28, 2016 at 1:58 PM, Alex Hall  wrote:
> Hi all,
> I've looked through the wiki and the docs, plus on Google, but can't find
> anything about customizing validation. We have two custom fields which may
> be empty or not, but if they have a value, it has to be of the right format.
> Both are single-line text fields. How would I set up RT so that I can apply
> a regular expression, or some other kind of formatting, to these fields?

It should be right there in the CF admin page.

There is even a drop down with some prepopulated options.

The (?# ) is a way to put a "human" name with the validation rule. For instance:

(?#State Abbreviation)^[A-Z][A-Z]$

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - Q1 2017


Re: [rt-users] Template snippet causes template to silently fail

2016-10-26 Thread Matt Zagrabelny
Hey Alex,

On Wed, Oct 26, 2016 at 4:29 PM, Alex Hall  wrote:
> Hi all,
> The way our company uses RT, there's no need to distinguish between comments
> and replies, and users may use either one without realizing the difference.
> In my new email template, I want to show whichever was set. My template
> works fine without the two if statements I'm trying to use, but as soon as I
> put them in, it fails. The odd thing is that, though the email using the
> template is never sent, I don't get any errors at all. When I was missing a
> dollar sign earlier, I got an error--an error not really related to the
> dollar sign, but an error. Now, though, I get nothing whatsoever. Here's the
> snippet:

You can see some documentation regarding txns at:

https://docs.bestpractical.com/rt/4.4.1/RT/Transaction.html

> { if (my $transactionCorrespond = $Transaction->correspond) {
> $transactionCorrespond
> } elsif (my $transactionComment = $Transaction->comment) {
> $transactionComment }
> }

# Here is some untested code...

my $type = $Transaction->Type;

# $type now holds "Correspond" or "Comment"

if ($type eq 'Correspond') {
# do something for correspond
}
elsif ($type eq 'Comment') {
# do something for comment
}
else {
# Perhaps this txn is a Create...
}

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Secondary Approvals

2016-10-26 Thread Matt Zagrabelny
Hi Brian,

On Wed, Oct 26, 2016 at 2:45 PM, Dunbar, Brian  wrote:

> Any help would be greatly appreciated.

I don't know about secondary approvals. If the approvals approach
doesn't solve your problem, you could solve it with a lifecycle.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Difficulty of turning one-time CC into full CC?

2016-10-25 Thread Matt Zagrabelny
Hi Alex,

On Tue, Oct 25, 2016 at 1:55 PM, Alex Hall  wrote:
>
> I know, in theory, how to make such a change now. What I'm wondering is how
> hard it might be. If anyone has ever done this before, can you give an idea
> of what is involved? The UI is one part, but what behind-the-scenes changes
> might I have to make? Is it as simple as changing an argument, or much
> worse? Am I changing the plate on an electrical outlet, or tearing down half
> the wall to change all the wiring?

You could leverage a callback. Ticket/Update.html has a callback named
BeforeDisplay. I don't know if that callback fires before the
transactions are created or not - that would be the question.

If it does fire before the transactions, then you could look at the
submitted ticket/txn data manipulate the ARGSRef to remove the
one-time ccs and add them in as ccs (if they aren't already ccs.)

I'm not sure the best way to go forward if the BeforeDisplay fires
after the txns are created.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


[rt-users] [phish?] Re: Identifying database credentials in use during upgrade?

2016-10-24 Thread Matt Zagrabelny
On Mon, Oct 24, 2016 at 7:09 AM, Alex Hall  wrote:
> Hello list,
> As I mentioned, the upgrade on my test server from 4.2.8 to 4.4.1 went well.
> On the production server, though, it's not; the upgrade-database script is
> failing when it tries to connect to the database. I've been in MySQL messing
> around with user permissions, trying to get things to work, but to no avail.
>
> How can I know exactly what username/password the script is using? It says
> in the error that the user is 'rt_user', yet in /opt/rt4/RT_Config.pm the
> configuration comment says it should be 'rtuser' (note the lack of an
> underscore).

Okay.

 It may be important to say that this line remains unchanged no
> matter how often I re-run ./configure with new options. On a related note, I
> have no idea what password is in use since it won't take my configuration
> command.

Your password should be in either RT_SiteConfig.pm or in a config
snippet in RT_SiteConfig.d/.

> I'm not sure what to try next. Do I erase RT_Config.pm and re-run
> ./configure?

Perhaps.

RT_Config.pm has all the *default* values shipped from upstream.

RT_Config.pm should never be edited by the administrator (you.)

There is RT_SiteConfig.pm and RT_SiteConfig.d for the admin to
override defaults.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Deleting one attachment

2016-10-19 Thread Matt Zagrabelny
On Wed, Oct 19, 2016 at 11:28 AM, Ram  wrote:
> Hi all,
> A user at work added an attachment that violates corporate policy to a
> ticket; the ticket itself is valid and must be kept. I need to delete the
> attachment. A quick look at the rt-shredder tool does not make it apparent
> to me how to do this with rt-shredder. I can readily do it editing the db in
> mysql but I'd rather use rt-shredder if it will do the job.
> any help?

Running 4.2.12 here...

# /opt/rt4/sbin/rt-shredder --plugin list
Plugins list:
Objects
SQLDump
Summary
Tickets
Attachments
Users

So it looks like it can shred attachments.

/opt/rt4/sbin/rt-shredder --plugin help-Attachments
USAGE
  masks
If any argument is marked with keyword `mask' then it means that this
argument support two special characters:

1) `*' matches any non empty sequence of the characters. For example
`*@example.com' will match any email address in `example.com' domain.

2) `?' matches exactly one character. For example `' will match any
string four characters long.

NAME
RT::Shredder::Plugin::Attachments - search plugin for wiping
attachments.

ARGUMENTS
  files_only - boolean value
Search only file attachments.

  file - mask
Search files with specific file name only.

Example: '*.xl?' or '*.gif'

  longer - attachment content size
Search attachments which content is longer than specified. You can use
trailing 'K' or 'M' character to specify size in kilobytes or megabytes.

Then perhaps something like:

/opt/rt4/sbin/rt-shredder --plugin
Attachments=files_only,1;file,some_secret_document.pdf

I didn't try the above and I would _for sure_ try it on a test system
first - at least a test ticket with a test attachment.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] RT 4.4.1 login form and 2FA

2016-10-17 Thread Matt Zagrabelny
On Mon, Oct 17, 2016 at 7:45 AM, Kem Hartley  wrote:
> RT Community,
> I'm trying to setup 2FA, specifically Duo, with the RT login process.  I'm
> having a difficult time figuring out where to place the duo perl code in the
> login process.  I'm using external LDAP authentication.  Once the successful
> login returns from LDAP, where does RT forward to the home page.  I need to
> put in the duo perl code before RT sends the authenticated user to the home
> page.  Any help would be greatly appreciated.  Thank you.

Are you looking to use LDAP for AUTHN or hack RT to use DUO?

I'm not sure if LDAP can use PAM for AUTHN, but if it can, you can use
a PAM RADIUS module and configure DUO on your RADIUS server.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Changes to html files not appearing

2016-10-13 Thread Matt Zagrabelny
Hi Alex,

On Thu, Oct 13, 2016 at 3:43 PM, Alex Hall  wrote:
> Hello list,
> I've made a change to ShowEmailRecord.html. I copied it to
> /local/html/Ticket, modified it, cleared the mason cache, and restarted
> both FCGI and Nginx. But I can't see my change on the website. Of course,
> this presumes I've correctly followed the chain of includes from the
> ShowTransaction template back to this html file. Did I miss a step?

Note: I've never used the /local/html Mason override.

>From what I understand, I don't think you missed a step.

 I'm on
> Debian, so cleared /opt/rt4/var/mason_data/cache/obj/*. Is there a different
> cache on Debian, even though I'm now running from source and not the
> pre-built packages?

Since you installed from source, there isn't a different location.
Only if you were using a packaged version of RT would the path be
dependent on the package.

However, if you cleared the mason cache at that location, then it is
wrong. You want:

sudo find /opt/rt4/var/mason_data/obj -mindepth 1 -delete

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] [phish?] Re: clarification on callbacks

2016-10-12 Thread Matt Zagrabelny
On Wed, Oct 12, 2016 at 8:44 PM, Alex Hall  wrote:
>
>> You would use local versions of the Mason components. RT doesn't (at
>> this point) have that modular or dynamic of an architecture.
>
> I hoped you weren't going to say that. :) I was looking earlier, to find 
> where exactly the download/with headers links and other extras get assembled 
> and inserted. I couldn't find any of it anywhere. I found ShowHistory and 
> ShowTransaction, but I couldn't find where the text of replies and other 
> transactions gets turned into what you see on the web UI. I must have missed 
> something obvious, but I can't see what.

You could always get (by paying) BPS to make the modifications to
upstream - then you'd get something that is supported for the future
and the community would benefit by getting new functionality.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


[rt-users] [phish?] Re: clarification on callbacks

2016-10-12 Thread Matt Zagrabelny
On Wed, Oct 12, 2016 at 3:53 PM, Alex Hall  wrote:
> Callbacks I get now, at least I'm pretty sure I do. I've been reading the
> docs for RT objects, and if I can use any of the properties and methods I've
> found, I can see how plugins are so powerful.
>
> My sticking point now is modifying what's already there. I can remove items
> from a menu with deleteKey, but I haven't found a way to remove items from
> other areas of RT and replace them with my own.

You would use local versions of the Mason components. RT doesn't (at
this point) have that modular or dynamic of an architecture.

It'd be great to have flexibility for users to see what they want in
the layout - it'd probably be a big-ish undertaking to implement it.

 My ultimate goal, as I've
> said, is to redo the ticket history section on ticket summary and history
> pages, to make it easier to read and follow. I have an idea of how I'd make
> the display I want to see, but how do I also get rid of the default one?

From:

https://docs.bestpractical.com/rt/4.4.1/writing_portlets.html

"Copy /opt/rt4/html/share/SelfService/index.html to
/opt/rt4/local/html/SelfService/index.html"

So if you wanted un-callback-able modifications made to your RT, then
you'd copy, for instance:

/opt/rt4/html/share/Ticket/Display.html

to

/opt/rt4/html/local/Ticket/Display.html

and then hack on the latter.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Using self service interface for privileged users in 4.4.1?

2016-10-12 Thread Matt Zagrabelny
On Wed, Oct 12, 2016 at 8:51 AM, Alex Hall  wrote:
> The below code is great, thank you. I'm trying now to figure out a way to
> toggle the interface while staying on the current page, but I'll have to do
> more reading first.
>
> Using callbacks, can I remove items from existing templates? That is, could
> I remove the 'Assets' menu item in addition to adding my own menu items?

Yep. We add menu items for our own extensions and also
remove/repurpose other menu items.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] create transaction record

2016-10-11 Thread Matt Zagrabelny
On Tue, Oct 11, 2016 at 4:09 PM, Bryon Baker  wrote:
> Yes I thought of the custom field and that would be easy, but I have so many 
> now. I just didn't want to add another.  But if I can't find anything else 
> that is what I will do eventually.

I'm sure there is a way to add a txn - apparently I've never done it
and would have to research (which I have no time for.)

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] clarification on callbacks

2016-10-11 Thread Matt Zagrabelny
Hey Alex,

On Tue, Oct 11, 2016 at 3:27 PM, Alex Hall  wrote:
> Hello list,
> I'm considering trying out a callback. Ken suggested it as a way to add a
> link to pages that will let users toggle between self-service and standard
> interfaces, and I'm very much hoping I can use it to customize the way
> history displays on ticket summary pages.
>
> From what I've read so far, it seems like a callback is analogous to a
> subclass. If I have a 'renderer' class that can make pretty text from raw
> HTML, I might then subclass it and override the function that parses text to
> make it work on XML. Yes, it's a very terrible example, but hopefully the
> idea is correct.
>
> Anyway, a callback in RT seems a lot like that. I want the ticket page to
> display how it already does, but I don't like the history part. Thus, I copy
> the file to the proper callback directory, then modify it. RT will, when it
> knows it has to use Display.html, look in callbacks first and use my
> version. Only if I don't provide one will it use the default one in
> share/html/Tickets.
>
> Do I have this right--copy the existing file to callbacks and modify it? Or
> do I make a blank file, override only the bits I want to in there, and not
> copy the whole thing? Am I thinking about callbacks all wrong?

You are thinking about Callbacks wrong. :)

They are hook points in the HTML (Mason) of RT.

Many (most?) RT extension will have some callbacks in them. Here is a
nice easy one to get your feet wet:

https://github.com/bestpractical/rt-extension-commentoncreate

Take a look at the source for this extension and note the
html/Callbacks directory. Then look in your RT share/html directory
for where those callbacks would appear.

In this particular instance, rt-extension-commentoncreate adds a
"comment" box just below the "create" content box on the
Ticket/Create.html page.

So you can see from the source of the extension, it will add something
to the AfterMessageBox callback in the Create.html Mason component.

I'll let you dig a little bit more with this extension or another one
to get more familiar with callbacks.

Also, read the documentation:

https://docs.bestpractical.com/rt/4.4.1/writing_extensions.html#Callbacks

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] create transaction record

2016-10-11 Thread Matt Zagrabelny
On Tue, Oct 11, 2016 at 2:25 PM, Bryon Baker  wrote:
> Yes that is what I am doing I hoping for some kind of call like 
> "$RT::Logger->debug" for logging. But I have not found anything.  The web 
> service call is actually being executed from inside custom home built actions.

That would work. Or:

RT->Logger->debug('a line of debug');

Regarding creating a txn for the ticket history: I may have at one
time created a txn and added it to the history, but I'm not seeing any
code examples in my extensions. I don't quite remember how and don't
have time to dig into the RT upstream code.

You could create a custom field called Web Services and set that CF to
whatever value your web services returns. That is pretty easy.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] create transaction record

2016-10-11 Thread Matt Zagrabelny
On Tue, Oct 11, 2016 at 1:54 PM, Bryon Baker  wrote:
> Matt
> Thanks for the reply.
>
> All I want to do is add an entry in the ticket history that contains the 
> return information from the call to the web service.  I have the information 
> logged to the log file, but I also want an entry record in the history of the 
> ticket.  So no action something very simple.
>
> I know when a custom fields are changed or updated this information shows up 
> in the history of the ticket.  With the web service call a message is 
> received but a custom field is not needed for the information, just would 
> like an entry in the history of the ticket of the message from web service 
> call.

I hear what you are saying. I don't know off the top of my head how to
accomplish it.

So you have:

Email -> RT -> Scrip gets triggered -> Web service call is made

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] create transaction record

2016-10-11 Thread Matt Zagrabelny
On Mon, Oct 10, 2016 at 4:16 PM, Bryon Baker  wrote:
> Hello List
>
>
>
> I have created a custom scrip the will respond to an email via a web service
> call.  I would like to create a transaction with the return message.

What do you want the txn to do? Set a custom field, change an owner, etc?

> Can someone give me a little code snippet or some direction on how to create
> the transaction?  With our creating or updating a custom field.

Generally you would probably want to have two scrips:

1. On Condition C, reply to (or notify) requestor using template T

2. On Condition C, perform your specific txn using a blank template.

But it is hard to give advice without a little more clarity in your question.

Thanks,

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Using self service interface for privileged users in 4.4.1?

2016-10-11 Thread Matt Zagrabelny
On Tue, Oct 11, 2016 at 8:05 AM, Alex Hall  wrote:
> Hello list,
> I have 4.4.1 running. Someone said on this list that it included the option
> to use the self service interface, even for privileged users? I don't see
> that option in my user preferences. How do I enable it, and can I have a
> toggle for users to switch between the two without leaving the ticket
> they're viewing? Thanks.

Privileged users can always browse to:

rt.example.com/SelfService

You can probably use a callback to add a link to the self service URL
for displaying a ticket.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Unable to connect to MySQL during RT upgrade

2016-10-11 Thread Matt Zagrabelny
Hi Alex,

On Mon, Oct 10, 2016 at 5:07 PM, Alex Hall  wrote:
> After a few more repeats of some of the below steps, suddenly things worked.
> I'm embarrassed to say I may have forgotten to specify rt441.* when granting
> privileges, instead only entering rt441. In any case, the upgrade finally
> ran, and I appear to be okay, save one thing: those RT_SiteConfig.d files.
> They're there, but I can't figure out how to make them apply. The
> 'update-rt-siteconfig' command still seems to be working on the 4.2.8
> install, not the new 4.4.1. I'm not sure how to get it to work on the new
> install.

RT_SiteConfig.d was a Debian-ism until 4.4 - then it became upstream.

In RT 4.4.x you no longer need to run the update-rt-siteconfig - that
is only applicable to Debian RT 4.2.

In RT 4.4.x the config gets dynamically built when the web server is started.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Path to upgrade 4.2.8 Debian package to 4.4.1 source install?

2016-10-05 Thread Matt Zagrabelny
Hi Alex,

You don't need a guide. You can follow the install instructions that
come with the RT source code.

You can use the same database - just be sure to apply the upgrade steps.

-m

On Wed, Oct 5, 2016 at 7:52 AM, Alex Hall  wrote:
> After thinking about it, I've come to realize that upgrading my test
> instance is the best way to go. I can practice upgrading, see if the new
> features will be useful on the active instance, and not have to worry about
> messing up a source code patch.
>
> I'm on 4.2.8, as that's what you get on Debian if you apt-get install
> request-tracker4. The latest release, though, is 4.4.1 I believe. What are
> the upgrade steps to upgrade, or am I better off removing RT and starting
> with 4.4.1? Either way, how do I keep my existing RT database (MySQL)? I
> believe there are db migration commands, but I don't know how they work.
> I've googled this, and have come up with only a couple hits, neither of
> which was a guide. I could have missed the article(s) people usually use for
> this process, of course. How do I upgrade, and/or is there already a
> resource people use to do this? Thanks!
>
> --
> Alex Hall
> Automatic Distributors, IT department
> ah...@autodist.com
>
> -
> RT 4.4 and RTIR training sessions, and a new workshop day!
> https://bestpractical.com/training
> * Boston - October 24-26
> * Los Angeles - Q1 2017
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] DB schema diagrams

2016-09-29 Thread Matt Zagrabelny
On Thu, Sep 29, 2016 at 9:34 AM,   wrote:
> Hello,
>
> I'm looking for the schema diagrams for RT 4.2.12, but on the wiki
> (https://rt-wiki.bestpractical.com/wiki/Schema) there are no links for the
> following files :
> - Rt schema.svg
> - Rt4-schema-relationships.svg
> and I can't find them on our RT. I only find a schema.dot file in the docs
> directory of RT, but have no tool to open it.

dot can be converted to other forms:

dot -Tpng input.dot > output.png

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Where is the 'privileged' group?

2016-09-27 Thread Matt Zagrabelny
Hi Alex,

You can grant rights to system defined groups:

So you can add the "Take Ticket" right globally to the Privileged users.

Admin -> Global -> Group RIghts

There you will see the system groups:

Everybody
Privileged
Unprivileged

Just a point that I got hung up on early on in my RT administration:

Privileged is not a subset of Unprivileged - there is no membership
overlap between those two groups.

-m

On Tue, Sep 27, 2016 at 7:51 AM, Alex Hall <ah...@autodist.com> wrote:
> I know I can make a user un-privileged. But all the users I'll be adding
> over the next week or so will need to have some rights, just not the right
> to add themselves to groups. I thought 'unprivileged' was an automatically
> created group I could manage like any other, so that all privileged users
> inherit the same rights unless and until an admin adds the user to a group
> with more rights later on. For instance, *all* our users must be able to
> take tickets, but not all of them should be able to add themselves to
> groups. Do I just need to make a "staff" group and add everyone to it? I
> can, I just had it in my head that RT had a way to do this automatically for
> all users not in any user-defined group.
>
> On Mon, Sep 26, 2016 at 5:11 PM, Matt Zagrabelny <mzagr...@d.umn.edu> wrote:
>>
>> Admin -> Users -> Select
>>
>> Let this user be granted rights (Privileged)
>>
>> -m
>>
>> On Mon, Sep 26, 2016 at 4:08 PM, Alex Hall <ah...@autodist.com> wrote:
>> > Hello again,
>> > I created a user, and he reported later that he'd added himself to the
>> > admin
>> > group. I was going to do that anyway, but I'm concerned that he had the
>> > right to do that on his own. I think the problem lies in the privileges
>> > I
>> > gave the 'privileged' group when I was first setting up RT. Now, though,
>> > all
>> > I can find are my own groups; the un/privileged ones are nowhere to be
>> > found. How do I get back to them to remove some rights from the
>> > privileged
>> > group? Thanks.
>> >
>> > --
>> > Alex Hall
>> > Automatic Distributors, IT department
>> > ah...@autodist.com
>> >
>> > -
>> > RT 4.4 and RTIR training sessions, and a new workshop day!
>> > https://bestpractical.com/training
>> > * Boston - October 24-26
>> > * Los Angeles - Q1 2017
>
>
>
>
> --
> Alex Hall
> Automatic Distributors, IT department
> ah...@autodist.com
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Where is the 'privileged' group?

2016-09-26 Thread Matt Zagrabelny
Admin -> Users -> Select

Let this user be granted rights (Privileged)

-m

On Mon, Sep 26, 2016 at 4:08 PM, Alex Hall  wrote:
> Hello again,
> I created a user, and he reported later that he'd added himself to the admin
> group. I was going to do that anyway, but I'm concerned that he had the
> right to do that on his own. I think the problem lies in the privileges I
> gave the 'privileged' group when I was first setting up RT. Now, though, all
> I can find are my own groups; the un/privileged ones are nowhere to be
> found. How do I get back to them to remove some rights from the privileged
> group? Thanks.
>
> --
> Alex Hall
> Automatic Distributors, IT department
> ah...@autodist.com
>
> -
> RT 4.4 and RTIR training sessions, and a new workshop day!
> https://bestpractical.com/training
> * Boston - October 24-26
> * Los Angeles - Q1 2017
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Enabling extensions in RT4.2.8?

2016-09-23 Thread Matt Zagrabelny
rllocal.pod
>> Couldn't load RT config file RT_SiteConfig.pm:
>>
>> Can't locate object method "InitPluginPaths" via package
>> "RT::Extension::PriorityAsString" (perhaps you forgot to load
>> "RT::Extension::PriorityAsString"?) at /usr/share/request-tracker4/lib/RT.pm
>> line 654.
>> Compilation failed in require at
>> /usr/share/request-tracker4/lib/RT/Config.pm line 1106.
>> Makefile:796: recipe for target 'install' failed
>> make: *** [install] Error 255
>>
>> Well, that's new. Obviously this is the source of the trouble, but what
>> does it mean and how do I fix it? As far as I remember, I didn't see this on
>> my last install, but I'm glad it's here now if it illuminates the core
>> problem! And no, I think I missted the RTHOME comment. I'm going to search
>> for it as soon as I send this.
>>
>> On Fri, Sep 23, 2016 at 3:31 PM, Matt Zagrabelny <mzagr...@d.umn.edu>
>> wrote:
>>>
>>> On Fri, Sep 23, 2016 at 2:20 PM, Alex Hall <ah...@autodist.com> wrote:
>>> > Okay, good to know about the permissions and deleting everything below
>>> > mason_data/obj. I re-created the obj directory and set it to
>>> > www-data:www-data 755.
>>> >
>>> > I ran perl -c on the main config file, with the two plugin lines
>>> > commented
>>> > out and not, and on the RT_SiteConfig.d/70-plugins file I made that
>>> > holds
>>> > those lines. In all three cases, Perl reports that the syntax is okay.
>>> >
>>> > To make sure I'm not going nuts from all the things I've tried
>>> > recently, I
>>> > tested things once more. I commented out the plugin lines, ran
>>> > update-rt-siteconfig and update-rt-siteconfig-4 (what's the
>>> > difference?),
>>>
>>> update-rt-siteconfig is a symlink. It points to
>>> update-rt-siteconfig-4. The command is obsolete in 4.4 since RT
>>> natively supports config snippets without needing a command to
>>> regenerate a site config.
>>>
>>> > and tried to spawn the FCGI server. It worked. Uncommented, and the
>>> > FCGI
>>> > server exited with status code 255 when not commented. Oh, between the
>>> > two
>>> > attempts I also ran the delete command you sent. Is there a step I'm
>>> > missing? Maybe something so obvious you didn't think to mention it?
>>> > This is
>>> > clearly atypical for RT plugins, so it almost has to be something I'm
>>> > missing/doing wrong.
>>>
>>> What did you do to install the module?
>>>
>>> Did you read my comment in a previous email about RTHOME?
>>>
>>> Please list the exact commands and their output.
>>>
>>> wget or curl?
>>> tar?
>>> perl Makefile.PL?
>>>
>>> etc.
>>>
>>> Maybe we'll see something.
>>>
>>> -m
>>
>>
>>
>>
>> --
>> Alex Hall
>> Automatic Distributors, IT department
>> ah...@autodist.com
>
>
>
>
> --
> Alex Hall
> Automatic Distributors, IT department
> ah...@autodist.com
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017

Re: [rt-users] Enabling extensions in RT4.2.8?

2016-09-23 Thread Matt Zagrabelny
On Fri, Sep 23, 2016 at 2:20 PM, Alex Hall  wrote:
> Okay, good to know about the permissions and deleting everything below
> mason_data/obj. I re-created the obj directory and set it to
> www-data:www-data 755.
>
> I ran perl -c on the main config file, with the two plugin lines commented
> out and not, and on the RT_SiteConfig.d/70-plugins file I made that holds
> those lines. In all three cases, Perl reports that the syntax is okay.
>
> To make sure I'm not going nuts from all the things I've tried recently, I
> tested things once more. I commented out the plugin lines, ran
> update-rt-siteconfig and update-rt-siteconfig-4 (what's the difference?),

update-rt-siteconfig is a symlink. It points to
update-rt-siteconfig-4. The command is obsolete in 4.4 since RT
natively supports config snippets without needing a command to
regenerate a site config.

> and tried to spawn the FCGI server. It worked. Uncommented, and the FCGI
> server exited with status code 255 when not commented. Oh, between the two
> attempts I also ran the delete command you sent. Is there a step I'm
> missing? Maybe something so obvious you didn't think to mention it? This is
> clearly atypical for RT plugins, so it almost has to be something I'm
> missing/doing wrong.

What did you do to install the module?

Did you read my comment in a previous email about RTHOME?

Please list the exact commands and their output.

wget or curl?
tar?
perl Makefile.PL?

etc.

Maybe we'll see something.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Enabling extensions in RT4.2.8?

2016-09-23 Thread Matt Zagrabelny
Hi Alex,


On Fri, Sep 23, 2016 at 12:15 PM, Alex Hall  wrote:
> Sorry for not replying in-line. I'd like to, but Google seems to have broken
> something in their accessibility, and I can't navigate the quoted text in my
> reply. The joys of using a screen reader.

It's okay. :)

> To your questions: I ran strace, and I have a 1.5mb file of output. I don't
> pretend to understand any of it, but I was scanning backwards from the
> bottom, and I may have found the problem.
>
> 12875 stat("/var/cache/request-tracker4/mason_data/obj",
> {st_mode=S_IFDIR|S_ISGID|0755, st_size=4096, ...}) = 0
> 12875
> stat("/var/cache/request-tracker4/mason_data/obj/.__obj_create_marker",
> 0x1bf8238) = -1 ENOENT (No such file or directory)
> 12875
> open("/var/cache/request-tracker4/mason_data/obj/.__obj_create_marker",
> O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 EACCES (Permission denied)
>
> When i cleared my mason cache, I deleted the obj folder as directed. It
> looks like this process can't re-create the necessary structure inside the
> mason_data directory.

Hmmm. Okay. It looks like my install of RT recreates the obj directory
- sorry for the assumptive advice.

Here is a better command for clearing your mason cache, but leaving
the obj directory:

% sudo find /var/cache/request-tracker4/mason_data/obj -mindepth 1 -delete

 I've made www-data the owner, but as I'm invoking this
> command as root, perhaps I need to do something different? I've also given
> /var/cache/request-tracker4/mason_data 777 permissions recursively, and that
> did the trick! What permissions should I set, though, to be sure it's as
> secure as it needs to be?

On my installs:

www-data:www-data and 0755

You should only need to set that for the "obj" directory as the RT
process will build the rest of hierarchy.

 Oh, I should say, the FCGI command I use is:
>
> spawn-fcgi -u www-data -g www-data -a 127.0.0.1 -p 9876
> /usr/share/request-tracker4/libexec/rt-server.fcgi
>
> www-data is the same user used in Nginx, and I gather they have to match.
>
> Anyway, back to the extension. Now that RT is running, I once again enabled
> the plugin and updated my settings (yes, my main configuration file updates
> as it should). But when I ran my FCGI command, I once again got the exit
> code 255 message. I deleted sason_data/obj again, but that didn't help. I
> reset the permissions, but that, too, did nothing. There's something odd
> happening with the extension enabled that doesn't seem to happen with it
> disabled. I'm not sure what the deal is, though. Has anyone ever seen this
> happen with an extension?

It almost sounds like your RT_SiteConfig.pm has invalid perl syntax.

Run:

perl -c /etc/request-tracker4/RT_SiteConfig.pm

Both before and after enabling and disabling your extension and
running the update-rt-siteconfig.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Enabling extensions in RT4.2.8?

2016-09-23 Thread Matt Zagrabelny
Hi Alex,

On Fri, Sep 23, 2016 at 7:07 AM, Alex Hall  wrote:
> Strange... I get an exit code of 255 on my FCGI server with the extension
> enabled.

Hmmm. Enabling extensions shouldn't be too complicated. There is
nothing tricky going on.

 If I comment out the lines in my Plugins file and update
> siteconfig, I get no error code, but the server immediately quits silently.
> There's nothing in any log to tell me what's going on, at least that I can
> find.

Is there a foreground option for your FCGI server?

Run it through strace?

strace -f /some/path/to/your/fcgi-server

 RT was working perfectly until I installed and enabled the
> PriorityAsString extension, though I don't know if the install itself or the
> attempt to modify my settings did it.

Check the actual siteconfig file after running your update-rt-siteconfig.

% view /etc/request-tracker4/RT_SiteConfig.pm

and see if the PriorityAsString is commented out or not.

> Is there a way to remove an extension so I can start over?

You'd remove the files on disk. I'm not sure if the makefile that is
generated has an uninstall target.

Now that we're talking about it, did you use the RTHOME variable to
set your RT libs when generating the makefile for the extension?

% tar xvfz some-rt-extension.tar.gz
% cd some-rt-extension
% RTHOME=/usr/share/request-tracker4/lib perl Makefile.PL

 I installed using
> the commands on its homepage, not CPAN, so I don't know if that caused a
> problem. I don't see any uninstall/remove commands on the plugin's page, but
> maybe there's a standard way using Perl commands that I don't know?

If there were a standard way, then it would be the makefile that gets
generated would have an uninstall target.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Enabling extensions in RT4.2.8?

2016-09-22 Thread Matt Zagrabelny
Hi Alex,

On Thu, Sep 22, 2016 at 12:50 PM, Alex Hall  wrote:
> Hi all,
> I can't seem to find the instructions for enabling extensions in 4.2.8. I've
> found some for 3.x, but I thought I read somewhere that the syntax is a bit
> different for 4.x. I know I add something to 50-debconf, but I'm not sure
> exactly what.

You can add the configuration "code" to any file in
/etc/request-tracker4/RT_SiteConfig.d.

The configuration "code" is:

Plugin('RT::Extension::PriorityAsString');

So you might have a file like:

/etc/request-tracker4/RT_SiteConfig.d/70-priority-as-string

with the aforementioned Plugin line.

Then run your:

update-rt-siteconfig-4

Then clean your mason cache:

sudo find /var/cache/request-tracker4/mason_data/obj -delete

and restart your webserver

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Not creating a user on CC

2016-09-22 Thread Matt Zagrabelny
On Wed, Sep 21, 2016 at 11:07 PM, Thierry Thelliez
 wrote:
> I am trying to avoid creating a user in the first place.

I'm not sure there is a way around that. The user record is integral
to the paper-trail auditability of RT.

 From what I have
> been able to trace in the RT code, a first class user is created from the CC
> field.

I'm not sure what you mean by first class user.


> But that's a bit confusing in our case.  We are using our own external
> authentication system and when CCs are automatically created, our system
> detects the new user and let them request a password.

Okay. Perhaps your external authentication system could make use of
the "comments" field in the users table. "Autocreated when added as a
watcher" is the value when users are, well, autocreated when added as
watchers. :)

What are you using for your external authentication system? It sends
new users an email telling them they may request a password?

  But since we just
> want them to be receiving emails, not accessing RT, a password leads them to
> confusion.  They cannot/should not see anything in RT.

Sure.

> Of course we could change our code to double check if these accounts are
> 'empty' (not members of anything).  But I was wondering if we could skip the
> user account in the first place.

I don't think you could skip the user account.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] what can custom fields do?

2016-09-21 Thread Matt Zagrabelny
Hi Alex,

On Wed, Sep 21, 2016 at 3:55 PM, Alex Hall  wrote:
> Hi all,
> I'm planning to add a "type" field globally. Initially, this will be a list
> containing "discussion", "problem", and, maybe, "critical issue". What I'm
> wondering, though, is whether the selection of a value from this list can do
> anything? That is, could selecting "discussion" force the priority to 0,
> while "critical" would force it to 40? I hope so, so I can add a "severity"
> dropdown list, letting users select from five importance levels and not
> worry about--or mis-type--the actual number.

Perhaps you could leverage this extension:

https://metacpan.org/release/RT-Extension-PriorityAsString

> Could I use this field in searches, like "type:problem"?

Yes.

 What else can
> custom fields do, if anything, or are they really only for searching and
> letting users see details the default RT doesn't include?

They are custom data that is associated with tickets, users, queues,
articles, assets, etc. You can make use of them in whatever way makes
sense for your organization.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Best way to set up test RT instance?

2016-09-21 Thread Matt Zagrabelny
On Wed, Sep 21, 2016 at 11:50 AM, Alex Hall  wrote:
> Hello all,
> I finally have RT sending out emails on the company's server, so we're ready
> to move forward with testing things and making changes. To that end, I'm
> wondering how everyone manages testing changes without affecting the primary
> instance, then moving those changes into production?

puppet, chef, ansible, cfengine, etc.

Unfortunately if you have never used a configuration management
system, then that adds an overhead cost to getting your RT test/prod
instances up and running.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Showing the tickets properly.

2016-09-21 Thread Matt Zagrabelny
Set($MaxInlineBody, 9);

https://docs.bestpractical.com/rt/4.4.1/RT_Config.html

-m

On Wed, Sep 21, 2016 at 1:23 PM, yugi  wrote:
> Hi
>
> I am using RT4.4.1.
> I got some complains from some of my users because most of the  times when
> users reply to tickets, normally by email, RT get the following message in
> the ticket body.
>
> “ Message body is not shown because it is too large.”
>
>
> I intend to avoid users to click in download (untitled) with headers to see
> the response or the comment …
>
>
> Does anyone know if is possible to raise the number of characters that a
> post admit to avoid this type of message when the users reply to tickets …
>
> -
> RT 4.4 and RTIR training sessions, and a new workshop day!
> https://bestpractical.com/training
> * Boston - October 24-26
> * Los Angeles - Q1 2017
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017

Re: [rt-users] Not creating a user on CC

2016-09-21 Thread Matt Zagrabelny
On Tue, Sep 20, 2016 at 4:26 PM, Thierry Thelliez
 wrote:
> Hello,
>
> Under RT 4.2, is it possible to not automatically create a user from the CC
> field?

It is possible to create a user - that has an email address as a
"name". RT uses the field "name" to mean username.

I just tested it on my 4.2 test system and it works.


> We would like that the CCed users receive emails from ticket correspondance
> without creating for class user accounts.
>
> In one email thread from 2015, I saw the reference to a variable:
> AutoCreateNonExternalUsers.  I am not entirely sure that this is what I
> need, but that does not seem to be available in 4.2, correct?

AutoCreateNonExternalUsers makes it sound like it auto creates local
users - I'm not sure how that applies here.

Perhaps that config variable is for an extension or extra module.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Changing logo, and viewing *all* tickets?

2016-09-15 Thread Matt Zagrabelny
On Thu, Sep 15, 2016 at 11:32 AM, Shawn M Moore <sh...@bestpractical.com> wrote:
> Hey Matt, Alex, et al,
>
>> On Sep 15, 2016, at 12:22, Matt Zagrabelny <mzagr...@d.umn.edu> wrote:
>> I suppose there could be one additional meta status: __Initial__
>>
>> BP, if you are reading, what do you think?
>
> If we were to add __Initial__, then __Active__ would have to change to not 
> include the initial statuses, otherwise it'd be very confusing that the names 
> don't line up.

I think __Initial__ could just be single status subset of __Active__.
No need to exclude it from __Active__. I love having opinions of
theoretical rabbit trails!

>> I don't have a use-case for it, though, but perhaps there exists a need. 
>> Anyhow, this is a theoretical point and mostly a rabbit trail.
>
> Indeed. Probably not worth it.

Agreed! :)

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Changing logo, and viewing *all* tickets?

2016-09-15 Thread Matt Zagrabelny
On Thu, Sep 15, 2016 at 7:35 AM, Alex Hall  wrote:
> Hello all,
> A couple questions from my boss that I don't know how to answer: can I
> change the logo and link that appears at the top of all RT pages? He wants
> it to be our logo and the link to go to our homepage.

Yep.

See $LogoURL and $LogoLinkURL

https://docs.bestpractical.com/rt/4.4.1/RT_Config.html


> The other question is about viewing tickets. As the head of the company, he
> wants, quite understandably, to have a way of viewing all open tickets
> regardless of queue. I've given the admins group all the permissions I could
> find, and added him to that, so he should have whatever rights are needed to
> do this. Yet, neither of us can find a way to bring up such a view. Tickets
> in which he is involved, sure, but not *every* active ticket in RT. Is there
> an easy way, or will have I have to make a special group that is admin CC on
> all tickets? I'd rather not, since that would give him a ton of unwanted
> emails.

This can be just a saved search. It is quite easy:

Status = '__Active__'

Using the meta status __Active__ will be a bit more robust than just
"open". Though if that is what you really want, then go ahead with
'open'.

He can load the saved search in his home page, or any dashboard, for
that matter.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] AdminCC on Queue Change

2016-09-14 Thread Matt Zagrabelny
On Wed, Sep 14, 2016 at 2:48 PM, Scott Koch <scottk...@gmail.com> wrote:
> Thanks for the response, I think you may have misinterpreted my issue, see
> below. RT is hard to talk about due to the language overlap(English words
> and RT terms), so I may have said something confusing.

Okay. Sorry about the noise. :)

> On Wed, Sep 14, 2016 at 3:33 PM Matt Zagrabelny <mzagr...@d.umn.edu> wrote:
>>
>> On Wed, Sep 14, 2016 at 1:20 PM, Scott Koch <scottk...@gmail.com> wrote:
>> > RT Version: 4.2.12 (install has existed since 2003 and survived many
>> > major
>> > upgrades)
>> >
>> > Expected Behavior: When I move a existing ticket from one queue to
>> > another,
>> > the new queues AdminCCs will apply to that ticket for future comments
>> > and
>> > correspondences. I'm not expecting to see that particular tickets's
>> > AdminCC
>> > settings change, but I expect when a comment is made that the queues
>> > AdminCC
>> > members show up in the BCC field of comment and correspondence emails.
>> >
>> > Actual Behavior:  On comments and correspondences to the moved ticket,
>> > it
>> > behaves as if there are no AdminCCs set on that queue, despite there
>> > being
>> > queue-wide AdminCCs set. The queue in question works as expected for the
>> > same AdminCCs when a ticket is created directly in that queue. I am not
>> > on
>> > the AdminCC list, so my actions should not be subject to the NotifyActor
>> > setting.
>>
>> The way you worded this last sentence gives the impression that you
>> have a different understanding of NotifyActor than I do. Perhaps it is
>> just how I read the sentence, but perhaps not.
>>
>> NotifyActor doesn't necessarily have anything to do with AdminCcs. It
>> has to do with the creator of the transaction (actor) and any email
>> recipients from scrips that would fire off from said transaction.
>> Generally "Notify" type actions will check if any of the recipients
>> are the actor of the txn, if they are, then those recipients won't get
>> an email - unless a configuration is set to do so.
>>
>
> I only mentioned NotifyActor to demonstrate to my audience that this setting
> isn't affecting the desired result, due to my user being the only user
> listed in the AdminCC setting(which is not the case). Forget I even
> mentioned it.

Forgotten.

>>
>> > I am trying to figure out if this feature, lets call it "Tickets moved
>> > to a
>> > new queue are affected by AdminCC of new queue", should be:
>> > - Something that should just work in RT out of the box(not a
>> > scrip/extention/site modification etc), this was my assumption initially
>>
>> Nope. It would be a scrip.
>
>
> The scrip you mention below is to notify on a ticket changing queues, that
> is not the feature I am chasing. I want the list of emails in the queue-wide
> AdminCC to get the typical notifications on all future comments and
> correspondences made to tickets(specifically tickets that are moved into a
> new queue).

Okay. Now I understand. :)

This feature works for tickets created in the original queue,
> and I don't see a script thats doing the notifications, so I assume its a
> built in RT feature?

Nope. Not a built-in feature. It would be a scrip. You can check the
mail headers in the email received from RT and find out what scrip
generated the email.

I believe it is the Message-ID. Here is one from our RT instance:

Message-ID: <rt-4.2.11-25648-1473706766-1296.116322-...@d.umn.edu>

The 116322 is the ticket ID. The 4 following it is the scrip:

rt4=# select description from scrips where id = 4 ;
description
---
 On Create Notify AdminCcs

So you could start with the emails that you are getting and see what
scrip is firing those off. After that, you could look at logs or add
debugging info to your scrip code.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] AdminCC on Queue Change

2016-09-14 Thread Matt Zagrabelny
On Wed, Sep 14, 2016 at 1:20 PM, Scott Koch  wrote:
> RT Version: 4.2.12 (install has existed since 2003 and survived many major
> upgrades)
>
> Expected Behavior: When I move a existing ticket from one queue to another,
> the new queues AdminCCs will apply to that ticket for future comments and
> correspondences. I'm not expecting to see that particular tickets's AdminCC
> settings change, but I expect when a comment is made that the queues AdminCC
> members show up in the BCC field of comment and correspondence emails.
>
> Actual Behavior:  On comments and correspondences to the moved ticket, it
> behaves as if there are no AdminCCs set on that queue, despite there being
> queue-wide AdminCCs set. The queue in question works as expected for the
> same AdminCCs when a ticket is created directly in that queue. I am not on
> the AdminCC list, so my actions should not be subject to the NotifyActor
> setting.

The way you worded this last sentence gives the impression that you
have a different understanding of NotifyActor than I do. Perhaps it is
just how I read the sentence, but perhaps not.

NotifyActor doesn't necessarily have anything to do with AdminCcs. It
has to do with the creator of the transaction (actor) and any email
recipients from scrips that would fire off from said transaction.
Generally "Notify" type actions will check if any of the recipients
are the actor of the txn, if they are, then those recipients won't get
an email - unless a configuration is set to do so.

> I am trying to figure out if this feature, lets call it "Tickets moved to a
> new queue are affected by AdminCC of new queue", should be:
> - Something that should just work in RT out of the box(not a
> scrip/extention/site modification etc), this was my assumption initially

Nope. It would be a scrip.

> - Something that is handled by a default scrip (we have done a lot of scrip
> additions, modifications, and possibly deletions? so i'm suspect of our
> current scrips)

I don't recall if there is a scrip out of the gates that does this. From:

https://github.com/bestpractical/rt/blob/stable/etc/initialdata

it doesn't look like there is a notify for ticket's queue changing.

> - Something that we can create our own scrip to handle

Here is our scrip. It runs under transaction batch:

rt4=# select * from scrips where id = 75 :G
-[ RECORD 1 
]--+---
id | 75
description| On Queue Change if Owner is Nobody Notify AdminCcs
scripcondition | 10
scripaction| 8
customisapplicablecode | my $is_queue_changed = 0;
   | my $is_owner_changed = 0;
   |
   | # We make a note of the owner because we have
another scrip
   | # which will email the AdminCcs if the owner
is being changed
   | # to or from Nobody
   |
   | my $is_owner_nobody  =
($self->TicketObj->Owner == RT::Nobody->id);
   |
   | my $batch = $self->TicketObj->TransactionBatch;
   |
   | if ($batch && ref($batch)) {
   | for my $txn (@$batch) {
   | if (($txn->Field || q{}) eq 'Queue') {
   | $is_queue_changed = 1;
   | }
   | elsif (
   | ($txn->Field || q{}) eq 'Owner'
   | &&
   | ($txn->Type || q{}) eq 'SetWatcher'
   | ) {
   | $is_owner_changed = 1;
   | }
   | }
   | }
   |
   | return ($is_queue_changed && !
$is_owner_changed && $is_owner_nobody);
custompreparecode  |
customcommitcode   |
template   | Queue Change
creator| 123670
created| 2014-06-09 21:08:54
lastupdatedby  | 123670
lastupdated| 2014-06-09 21:09:44
disabled   | 0



> - Or am I completely missing something?

I don't think you are missing anything. If it used to work, then check
your scrips and if those look in order, look at logs or start adding
debugging statements to the code.

> Any information that can be provided about how queue AdminCCs apply to
> tickets(especially those moved to the queue, instead of create) would be
> greatly appreciated.

Queue adminccs exist as well as ticket adminccs - at the end of the
day, they are both adminccs, but the queue ones exist more in the
background - you don't see them on the ticket display page.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 

Re: [rt-users] Changing Text on RT Login Page

2016-09-13 Thread Matt Zagrabelny
On Mon, Sep 12, 2016 at 7:11 PM, Tim Gustafson  wrote:
> Hi,
>
> We just moved a bunch of users to an RT instance that uses LDAP
> authentication, as opposed to RT-specific passwords.  Some of our
> users don't read our announcement e-mails (imagine that...) and are
> trying to log in using their old RT-specific password, which is
> causing them to send e-mails asking why they can't log in.
>
> What's the "official" way to modify the login page's HTML to include
> some information about using their LDAP password?

Callbacks.

There are a couple of ways, callbacks and local overrides. Callbacks
are more flexible and allow upgrades to continue to occur without
impediment.

https://docs.bestpractical.com/rt/4.4.1/writing_extensions.html

In share/html/Elements/Login there are a few callbacks:

$ grep -i callback share/html/Elements/Login
% $m->callback( %ARGS, CallbackName => 'Header' );
% $m->callback( %ARGS, CallbackName => 'BeforeForm' );
%# Give callbacks a chance to add more control elements
% $m->callback( %ARGS );
% $m->callback( %ARGS, CallbackName => 'AfterForm' );

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Using Markdown in RT?

2016-09-09 Thread Matt Zagrabelny
On Fri, Sep 9, 2016 at 9:43 AM, Alex Hall  wrote:
> I've switched my own account to use that simple editor, but does it already
> handle Markdown syntax? If not, is there a plugin or setting to enable such
> support?
>

It does not natively handle MD. A quick google did not yield any MD
extensions for RT.

It looks like there are JS MD editors - though I am not sure how much
effort it would take to make an extension that uses them. Perhaps just
a jquery call to change the textarea.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Using Markdown in RT?

2016-09-09 Thread Matt Zagrabelny
On Fri, Sep 9, 2016 at 9:09 AM, Alex Hall  wrote:
> Hello list,
> Is there any way I can replace the default WISIWYG editor with a simple
> Markdown composition editor? I woouldn't want this for everyone, but for me,
> Markdown is far easier to deal with than the default editor. A few others in
> my company may also prefer it, and I wouldn't mind having the option
> available to anyone who prefers it. Is this possible?

Under user preferences one can disable the WYSIWYG editor - and thus
use a regular textarea box.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Best way to email members of group on ticket creation?

2016-09-06 Thread Matt Zagrabelny
On Tue, Sep 6, 2016 at 2:42 PM, Alex Hall  wrote:
> Yet another question. :) As I mentioned before, I have a setup where the
> Graphics queue has two groups: graphics_staff and graphics_admins. I added
> the rights on each group from within the queue's 'group rights' section, so
> that should grant group members those rights in that queue.
>
> What I want to do now is have all queue members receive an email whenever a
> new ticket is created.

Sure.

 This way, members will get notified anytime their
> queue gets a new task added to it. I looked into doing this with a script,
> but didn't find a way of sending emails to groups. At least, not without
> using custom code, which I doubt I'm up to at this stage. I saw a lot about
> CCs and Admin CCs, and am wondering if that's the best way to go.

It is.

 If it is,
> how would I make members of a given group adopt those roles automatically?

Admin -> Queues -> Select -> Watchers

Enter the group name "graphics" to the group search. Click Go.

The results will be at the bottom of the page and you can assign
watcher roles to the groups. Then click Save Changes.

> For instance, say the best solution is to have graphics_staff be CCs, and
> graphics_admins be admin CCs. That way they all get the emails through the
> default scripts. How do I set things up so that members of those two groups
> are made the right CCs when added to the group?

That part happens behind the scene.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Assigning rights to groups for queues

2016-09-06 Thread Matt Zagrabelny
Hey Alex,

On Tue, Sep 6, 2016 at 2:11 PM, Alex Hall  wrote:
> That's okay, let me ask it this way. If I give a group rights in a queue, I
> enter the group's name and select it from the list of matches.

Correct.


 When I do
> that, the group appears as a tab, next to CC, Admin CC, Requestor, and all
> the other tabs.

Let's stop here and clarify things a bit. When you type a group and
select it, one of two things happen:

1. RT knows if that group has been granted rights. If the group typed
in and selected has granted rights, it displays the tab with that
group. Note: there would have already been a tab with that group
loaded in the page. Thus, RT uses JS to display that tab.

or

2. RT knows that the group has not been granted any rights for this
queue and it uses the "Add Group" "tab" to grant rights for the
dynamically loaded group to the statically listed rights.


 When I toggle the checkboxes and hit 'save', that last tab
> that had the selected group's name on it is gone.

Correct.

 Is it somewhere else on
> the screen that I'm missing, or do I have to re-select the group after every
> time I save any changes I've made?

It is somewhere else on the screen after clicking save and the page
reloads. Its name is placed with the other custom groups that have
rights granted for this queue. The "Add Group" tab is now freed up to
allow additional dynamic groups to be granted rights.

However, you do not need to (re)select it, the page load already has
it selected as that was the group you were last granting rights to.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Assigning rights to groups for queues

2016-09-06 Thread Matt Zagrabelny
Hi Alex,

On Tue, Sep 6, 2016 at 1:48 PM, Alex Hall  wrote:
> Sorry to be difficult, but is there a way of knowing the selected group
> aside from its bold status? Could you explain where, maybe in the tab order
> or by what text I'd look for, the left pane is? I'm using a screen reader,
> since I can't see the screen visually, so have to do everything with tab,
> arrows, and knowing what text is near what to give myself landmarks.

I've never used a screen reader, so I don't have good context for what you need.

That said, I'm not sure there is going to be good landmarks.

The page loads all the rights granted for the queue. It then uses JS
to display the data in a more digestible manner.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Assigning rights to groups for queues

2016-09-06 Thread Matt Zagrabelny
On Tue, Sep 6, 2016 at 1:28 PM, Alex Hall  wrote:
> Hi all,
> Sorry for all the questions. Now that the hard part is out of the way, I'm
> configuring our test RT instance and keep running into little things I don't
> get. I'm on RT 4.2.8, so some of the below could be bugs that have been
> fixed in newer versions.
>
> I have a Graphics queue, and two groups--graphics_staff and
> graphics_admins--as some on this list have suggested. I go to the Graphics
> queue, select group rights, type graphics_admins into the group field, and
> choose that group. Now I'm editing what rights members of the
> graphics_admins group have within the graphics queue, right?

Correct.

>
> I check the first box in the list and hit the 'save' button. Now, the first
> point of confusion: the box remains checked, but the group I'd selected is
> no longer displayed.

See attached image. I typed pnteam into the "add group" box and then
checked the "allow sanctioning of devices" checkbox, then save.

This is the resulting screen shot.

Don't mind the grey background hinting - that is a patch from 4.4
carried back to this 4.2.11 instance.

 What happened: did the group get assigned that right,
> or did everyone?

See what group is bolded on the left pane. That is the group that the
current checkboxes on the right are displaying.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017

Re: [rt-users] How do users/new tickets via email work?

2016-09-06 Thread Matt Zagrabelny
Hi Alex,

Comments inline.

On Tue, Sep 6, 2016 at 10:16 AM, Alex Hall  wrote:
> Hi all,
> RT is working well, sending and receiving email, which is wonderful
> news--thanks again for all the help. What I'm wondering is how emailed
> tickets work in terms of users.
>
> If I email in a ticket from the address I have registered with my RT
> account, that works fine. I just had a coworker do the same, and it again
> worked. This coworker, though, has no account at all on RT. What is he now?

Email that comes into RT that has no previously created user
associated with the email address is from the special group Everyone.
Once they

> A user?

Sort of. They exist in the users table, but do not have a username -
the field in the table is called, "name".

 A ticket holder, but with no permanence in RT aside from that email
> address?

They would be the requestor of the ticket. There really isn't a
"ticket holder" - just the different roles that are associated with
tickets. Requestors, Ccs, AdminCcs, Owner, etc.

 He's not in the list of users, so he must not "officially" exist,
> but where is he?

There are different config settings to control what users get
displayed with autocomplete.

 If I were to go in right now and add him, with that same
> email address, as a user, would his ticket show as being on behalf of him,
> the new user?

I don't see evidence in the DB schema, but I believe the email address
is unique per user.

> The way our company works, my boss won't want any old user submitting
> tickets. He wants this to be internal for the most part, so I imagine he'll
> want me to make it so only registered users can send emails that open
> tickets. Is there a way to do this?

Grant rights. There are a few different ways to attack this.

Don't grant create ticket (or reply to ticket, or etc.) to Everybody.
This will close the loop of unknown users being able to send email to
the system and have tickets created and those email addresses show up
in the users table.

Create users in your system that you want to be able to "do stuff".
These would be the employees of the company. Then grant rights to
those users. You could make those users privileged and then use the
special group Privileged to make life easier.

Or leave the users as unprivileged and grant rights to the
Unprivileged group. Priv vs Unpriv will dictate what interface (Full
UI vs SelfService UI) the users will see via the web interface.
Depending on what level of interaction you want the general audience
to have will drive whether you make them priv or unpriv.


 That is, a way to only accept emails
> where the sender's address is already attached to an active user?

Explained above.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Ading users to queues?

2016-09-04 Thread Matt Zagrabelny
On Sun, Sep 4, 2016 at 7:41 AM, Alex Hall  wrote:
> Okay, I think I get it. Users themselves are never added to queues.

You *could* add users to queues, or grant users rights. However, you
never *should*.

Always abstract through a group.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Making another user a full admin?

2016-09-02 Thread Matt Zagrabelny
On Fri, Sep 2, 2016 at 4:18 PM, Alex Hall  wrote:
> Thanks, I've done it. My only question is, given that the checkbox was in
> the 'admin' tab of that page, do the members of the group have to be admins
> in some other way before the privileges kick in?

Nope. They just need to be group members of the group that you are
granting that right to. The "Admin" tab of that page just means
"administrative-esque rights".


 The way the page is set up,
> it makes it sound like you can grant rights to everyone, staff, and admins,
> as though admins were a separate type of user like privileged versus
> non-priveleged users?

You can grant rights to a variety of groups - some are predefined meta
groups and some are custom created groups. This is where you would
grant rights globally for groups.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Making another user a full admin?

2016-09-02 Thread Matt Zagrabelny
On Fri, Sep 2, 2016 at 3:36 PM, Alex Hall  wrote:
> Hi all,
> I want to make my boss the other admin in RT (I'm still logged in as root,
> so wouldn't mind making myself a real account that's also an admin). I'm in
> the user rights area, and can allow users to do things, but how do I make a
> given user a full system admin? Not a queue admin, but rather at the same
> level as the root account? Thanks.

Create a group - call it Admin or something similar. Make your (new)
account and your boss' account both members of that group. Then give
the group global superuser rights.

Admin -> Global -> Group Rights

Check the "Do anything and everything" (Superuser) checkbox. Save changes.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] Using rt4-fcgi with RT on Debian?

2016-09-02 Thread Matt Zagrabelny
Hi Alex,

[I see you replied since I started this email.]

Some comments inline, but first let me say:

I've used Debian for a long time. I've also used RT for a while - both
installed via the deb packages and installed from source. With either
route, it is pretty painless.

For installing from source, all the perl dependencies are available
for RT 4.4.1 in jessie, jessie backports, and stretch repositories.

jessie backports
libencode-perl

stretch
libdata-page-pageset-perl
libhtml-formattext-withlinks-andtables-perl

Here is the list of dependency packages:

libterm-readkey-perl
libregexp-common-net-cidr-perl
libencode-perl
starlet
libtext-wikiformat-perl
libtime-parsedate-perl
libuniversal-require-perl
libtree-simple-perl
libdata-page-pageset-perl
libdatetime-perl
libmodule-versions-report-perl
libipc-run3-perl
libdata-guid-perl
libemail-address-list-perl
liblocale-maketext-fuzzy-perl
libxml-rss-perl
libhtml-mason-psgihandler-perl
libtext-wrapper-perl
libhtml-mason-perl
libdata-ical-perl
libhtml-scrubber-perl
librole-basic-perl
libdatetime-format-natural-perl
libsymbol-global-name-perl
libscope-upper-perl
liblocale-maketext-lexicon-perl
libdbix-searchbuilder-perl
libhtml-quoted-perl
libconvert-color-perl
libdate-extract-perl
libjson-perl
libtext-quoted-perl
libcss-squish-perl
libhtml-rewriteattributes-perl
libhtml-formattext-withlinks-andtables-perl
libtext-password-pronounceable-perl
libapache-session-perl
libbusiness-hours-perl
libmime-tools-perl
libregexp-ipv6-perl
libnet-cidr-perl
libdate-manip-perl
libcrypt-eksblowfish-perl
libgd-graph-perl
libperlio-eol-perl
libgnupg-interface-perl
libipc-run-perl
libgraphviz-perl
libcrypt-x509-perl
libstring-shellquote-perl
libcrypt-ssleay-perl
libcss-minifier-xs-perl
libjavascript-minifier-xs-perl

You'll want to pin the preferences for those other repositories like so:

% head -n -0 /etc/apt/preferences.d/*
==> 
/etc/apt/preferences.d/100_request_tracker_4_4_packages_from_jessie_backports
<==
Package: libencode-perl
Pin: release n=jessie-backports
Pin-Priority: 995


==> /etc/apt/preferences.d/200_request_tracker_4_4_packages_from_stretch <==
Package: libdata-page-pageset-perl
Pin: release n=stretch
Pin-Priority: 995

Package: libhtml-formattext-withlinks-andtables-perl
Pin: release n=stretch
Pin-Priority: 995


==> /etc/apt/preferences.d/500_stretch_pinning <==
Package: *
Pin: release n=stretch
Pin-Priority: 90

And lastly, when installing (from source) you'll need to tweak a line
in the rt-test-dependencies file:

rt-4.4.1/sbin/rt-test-dependencies

remove this line:
% grep Mozilla rt-4.4.1/sbin/rt-test-dependencies
Mozilla::CA

That perl module is covered by a Debian package by a different name.

Here is the configure I use. Very similar to the Debian package configure:

./configure --enable-graphviz --enable-gd --enable-gpg
--with-rt-group=root --with-web-user=www-data
--with-web-group=www-data --with-web-handler=fastcgi
--with-libs-group=root --with-db-type=Pg --with-db-dba=postgres

You'll want to change the web-handler to fcgi.

That is the gist of installing from source.

On Fri, Sep 2, 2016 at 2:15 PM, Alex Hall  wrote:
> Hi all,
> I thought I'd start a new thread for this, since the question got asked in a
> thread that didn't specifically relate to FCGI. I was told by one list
> member to install the rt4-fcgi package to help serve RT on Debian through
> Nginx. I've done so, but am not sure how to get it working or what commands,
> if any, are available.
>
> I have the 'rt' site in Nginx set to use 127.0.0.1:8485, and that works
> initially if I use spawn-fcgi. However, I then run into the problem I had
> last week, where Firefox says the page isn't redirecting properly. The
> message is:

> The page isn’t redirecting properly
> Firefox has detected that the server is redirecting the request for this
> address in a way that will never complete.

Look at the HTTP headers and see what is exactly happening. Use
Firebug, or LiveHTTPHeaders, or the developer tools in Chrom(e|ium).

> The initial page works correctly, but I get the above as soon as I log in.
> If I run the useful command I just found, tail -f /var/log/messages, I see
> only come configuration problems from an hour before when I most recently
> tried to access the site. The Nginx error log for RT is empty, and the
> access log shows only the failed attempts I made earlier in the day.

Sure. It sounds like nginx doesn't actually serve anything, thus
nothing to log. Perhaps tweak logging for nginx.

> I have a feeling that my changes to the name, location, and other settings
> just haven't taken effect yet.

From your reply it sounds like you are on the right track.

Cheers!

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017

Re: [rt-users] Check if Custom Field is empty?

2016-08-24 Thread Matt Zagrabelny
Hello,

On Wed, Aug 24, 2016 at 6:17 AM, PeterMairGO  wrote:
> Hello,
> I'm scripting a custom condition before a email will be sent.
> I've tryed this: ($self->TicketObj->FirstCustomFieldValue('Solution') =!
> 'NULL')

Unfortunately, at a minimum, your perl is wrong. You were looking for
'!=', not '=!'. However with strings you want 'ne' instead of '!='.
The latter is for numeric comparisons.

my $a = 'Hi';

if ($a ne 'Goodbye') {
print "Good.\n";
}

Some more things...

What version of RT are you running?

I would try a little script like this to test things out:

#!/usr/bin/perl

use strict;
use warnings;

use lib qw(
/opt/rt4/lib
/opt/rt4/local/lib
);

use RT -init;
my $t = RT::Ticket->new(RT->SystemUser);

$t->Load($ARGV[0]);

my $cf = $t->FirstCustomFieldValue('Solution');

if (defined $cf) {
print "$cf\n";
}
else {
print "__NOT_DEFINED__\n";
}

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] rt-shredder & bash script

2016-08-23 Thread Matt Zagrabelny
On Tue, Aug 23, 2016 at 10:47 AM, Tom Corcoran  wrote:
> Hi
>
> Noob question here.
> Trying to use rt-shredder from a bash script using a bash date variable to
> wipeout tickets but shredder seems to ignore my date  parameter which I
> assume is because its badly formatted.
>
> Have gotten this to work using a fixed date/time -
>
> #!/bin/sh
> filename=`date +%Y%m%dT%H%M%S-0001.sql`
> /opt/rt4/sbin/rt-shredder --sqldump /opt/stf/backups/rt-shredder/$filename
> --force --plugin Ti
> ckets=query,"(Queue = 'Supplier invoices') AND status = 'resolved' AND
>  resolved > '2016-08-01 00:00:00.00' ;limit,2000"
>
> but I would like it to work like this -
>
> #!/bin/sh
> filename=`date +%Y%m%dT%H%M%S-0001.sql`
> cutoff=`date +%Y-%m-%d --date='2 years ago'`
> cutoff="'$cutoff 00:00:00'"
> echo $cutoff
> /opt/rt4/sbin/rt-shredder --sqldump /opt/stf/backups/rt-shredder/$filename
> --force --plugin Ti
> ckets=query,"(Queue = 'MCL - Supplier invoices') AND status = 'resolved' AND
> resolved > $cuto
> ff ;limit,2000"

I believe shredder will respect relative time constraints:

1 day ago

etc.

You could try passing a relative date to shredder (thus bypassing the
call to date) and seeing if that works.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017


Re: [rt-users] manipulate correspond content in history

2016-08-19 Thread Matt Zagrabelny
Hi Woody,

On Fri, Aug 19, 2016 at 7:26 AM, Woody - Wild Thing Safaris
 wrote:
> HI all,
>
> My correspond scrip adds a table of CF values to the correspond email from
> the template, and sends to the client. I would like those same changes
> appended to the transaction content that appears in the history, so it
> matches what was sent to the client and we know easily what was sent.
>
> to test i have made a scrip, on correspond, custom action, template blank
>
> action is
>
> my $content = $self->TransactionObj->ContentObj->Content;
> $content .= "SOME OTHER STUFF";
> $self->TransactionObj->ContentObj->SetContent($content);
>
> no errors, but the content is not changed

The Txn already happened and its content is immutable - sort of. That
is, transactions (txns) are the atomic unit of data in RT. Those are
the things that make sure the paper trail exists for all the other
objects (users, tickets, queues, etc.)

That said, there is enough rope to do what you want. I don't know
exactly the procedure because I haven't implemented your use-case.

You'll want to expose the Transaction's parent's _Set method. In a
local module that gets loaded have some code like:

# {{{
# paper-trail auditor backdoor :)
# Needed to change the txn's content
package RT::Transaction;

use strict;
no warnings qw(redefine);

sub _Set {
my $self = shift;
$self->SUPER::_Set(@_);
}
# }}}

There may be more steps beyond this, but I think you'll need this at a minimum.

-m
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - September 12-14, 2016


  1   2   3   >