[rt-users] Some RTIR automation?

2010-10-22 Thread Landon Stewart
Many times a day I will login to RT+RTIR and consolidate Incident Reports
into Incidents using the IP address field in RTIR.  Is there any way to
automate the consolidation process of Incident Reports into Incidents where
there's an IP address?  I would imagine it's possible but I'm not sure what
to try even.

For those who may not have seen it - RTIR is an addon for RT.  It creates
three queues called Incident Reports, Incidents and Investigations.
Incident Reports can be merged or multiple Incident Reports can be linked to
a single Incident.  An Incident can be used to create a new ticket called an
Investigation.  In our case we use this to consolidate abuse issues reported
by outside parties by linking individual Incident Reports into Incidents and
then opening an investigation with our customer.  After our customer replies
to the Investigation and we can then respond to all the Incident Reports
separately and all at once when the Incident is resolved.

I had thought, maybe using code in a template, to script the creation of an
Incident if no other *open* Incident exists with the IP address(es) from the
Incident Reports.  If an Incident exists with that IP address and it's *open
* it links the new incident report with that incident.  Can a script inside
a template create an Incident?

Then at regular times I can simply list the incidents and open
investigations where needed and look for incident reports with no IP address
in them (rare).

Does anyone have any ideas on how to go about this?

Thanks to anyone who has any ideas on where to start here.

-- 
Landon Stewart 
SuperbHosting.Net by Superb Internet Corp.
Toll Free (US/Canada): 888-354-6128 x 4199
Direct: 206-438-5879
Web hosting and more "Ahead of the Rest": http://www.superbhosting.net


Re: [rt-users] Some RTIR automation?

2010-12-17 Thread Landon Stewart
Hello RT-Users,

To recap what I wrote about in this thread before was:
- An incident report comes in...
- If it has at least one IP address in the _RTIR_IP field do EITHER:
-- Link to an existing incident by IP address *OR*
-- Create a new incident

(The goal is to automatically group Incident Reports by IP address instead
of doing it manually.)

Ruslan wrote back saying:

> It's totally doable with scrips. RTIR itself has a lot of examples
> with bits you need. Basicly you need:
>
> When IR is created with and IP is set or when IP is changed from no
> value to a value, link to existing incident or create a new one. First
> part is a condition and second part is an action.
>
> For example lib/RT/Condition/RTIR_
> BlockActivation.pm is quite close.
> Checks whether ticket is created with active state or state is changed
> to active.
>
> Action is not that straightforward, but try it and if you have
> problems return back to us with detailed questions.
>


OK lets talk about the Condition first...

Is this enough to trigger the condition?
my $self = shift;
my $txn = $self->TransactionObj;
my $type = $txn->Type;
return 1 if $type eq 'Create'
  && ($self->TicketObj->FirstCustomFieldValue('_RTIR_IP'));

The other thing is the action... I really don't know where to start on the
action.  I know its going to be lengthy though because there's some checks
has to do itself to decide what the exact course of action will be.

Here's what it should do, I think:
- foreach IP address in _RTIR_IP
-- Look for an Incident that contains that IP address
-- When it finds one, LINK to that Incident
-- If it does not find one, create a new Incident

There will probably need to be a list of exclusions somewhere.  For example
if someone does a lookup on a domain we host and sends a complaint about it
they might sent the domain name, the IP address it resolves to as well as
the IP address of our name server.  I wouldn't want every report that
contained the IP address our name server linked to a common Incident.

Also there's a what if here...  What if they report two IP addresses that
already each have an Incident created for them.  Would I merge them all
together into one Incident?

Any ideas on where to start writing the action and reviewing the condition
above would be appreciated.  On or off list is fine with me.

Thank you!

-- 
Landon Stewart 
SuperbHosting.Net by Superb Internet Corp.
Toll Free (US/Canada): 888-354-6128 x 4199
Direct: 206-438-5879
Web hosting and more "Ahead of the Rest": http://www.superbhosting.net


Re: [rt-users] Resource usage spikes

2010-12-21 Thread Landon Stewart
On Tue, Dec 21, 2010 at 11:11 AM, Carlos A. Carnero Delgado <
carloscarn...@gmail.com> wrote:

> Hi,
>
> RT newb here. My team is currently testing RT to see if (and how well)
> it would serve us. So far so good, with one exception: every now and
> then, the web interface is completely unresponsive for a couple of
> minutes. When I get into the system's console, I see Apache taking
> 100% of processors during the spike. When the usage falls, everything
> goes back to normal: behavior is a lot faster and it keeps going on
> like that for several hours until the next spike.
>
>
Hi Carlos,

I had this exact same problem with RT from packages on a CentOS machine.
When I installed it from tar.gz I didn't have the problem.  It almost seemed
like there was missing database indexes or something but when I checked the
SQL usage it was complete idle.  I couldn't ever pin down what was using all
the resources.  The installation I'm running now has been upgraded once and
has been running for over a year.  We are up to ticket #19469 now.

-- 
Landon Stewart 
SuperbHosting.Net by Superb Internet Corp.
Toll Free (US/Canada): 888-354-6128 x 4199
Direct: 206-438-5879
Web hosting and more "Ahead of the Rest": http://www.superbhosting.net


Re: [rt-users] "Password: Password: Permission Denied"

2011-01-10 Thread Landon Stewart
On Mon, Jan 10, 2011 at 12:54 PM, Richard Pickett <
richard.pick...@csrtechnologies.com> wrote:

> Subject says it all.
>
> I create a new user, mark that they can be granted rights, set their
> password, etc. When the user then goes to change their password (after
> logging in), that's the error they get.
>
> Ideas?
>

Hi Richard,

Perhaps the user or their group does not have "ModifySelf" rights?

-- 
Landon Stewart 
SuperbHosting.Net by Superb Internet Corp.
Toll Free (US/Canada): 888-354-6128 x 4199
Direct: 206-438-5879
Web hosting and more "Ahead of the Rest": http://www.superbhosting.net


Re: [rt-users] stupid question (noob)

2011-01-10 Thread Landon Stewart
On Mon, Jan 10, 2011 at 2:29 PM, Chris Barnes  wrote:

> We have just started using RT and are quite pleased with our initial
> impressions.   But there is one thing I *really* wish it would do and am
> hoping there is a configuration tweak I can make
>
> There is an open ticket
> * We use the "Reply" link/button to get information back from the user
> * The user replies to the email message (properly keeping the subject line
> in-tact
>
> --> is there anyway for RT to indicate that there is "new information" in
> the ticket that we need to look at?
>

When I reply to the 'requestor' I mark the ticket status as "Stalled" unless
there's more I need to do before they get back to me with more information.
When they reply it will automatically be marked with a status of "Open"
again (as per a global Scrip).

Appart from that you can modify the ticket list to include the 'last updated
time' and 'last updated by' fields and even sort by the time field so you
can see the oldest first or something.

-- 
Landon Stewart 
SuperbHosting.Net by Superb Internet Corp.
Toll Free (US/Canada): 888-354-6128 x 4199
Direct: 206-438-5879
Web hosting and more "Ahead of the Rest": http://www.superbhosting.net


Re: [rt-users] Prevent CC address from adding to notification list

2011-03-02 Thread Landon Stewart
Hi Simon,

In RT_SiteConfig.pm:

Set($ParseNewMessageForTicketCcs , 0);

On Wed, Mar 2, 2011 at 10:17 AM, Simon Gao wrote:

> Hi,
>
> Is there a way to prevent email addresses on CC list from being added to RT
> notification list?
>
> Simon
>



-- 
Landon Stewart 
SuperbHosting.Net by Superb Internet Corp.
Toll Free (US/Canada): 888-354-6128 x 4199
Direct: 206-438-5879
Web hosting and more "Ahead of the Rest": http://www.superbhosting.net


Re: [rt-users] Prevent CC address from adding to notification list

2011-03-02 Thread Landon Stewart
Hey Simon,

I think you just have to modify the Scrip with the action "Notify Requestors
and Ccs" and set it to "Notify Requestors" instead.

RT -> Configuration -> Queues ->  -> Scrips

The ones I'd check out from the defaults are "On Create Notify AdminCcs" and
"On Correspond Notify Requestors and Ccs with template Correspondence".

On Wed, Mar 2, 2011 at 10:24 AM, Simon Gao wrote:

> Thanks. What about just for one queue, not applied to all other queues?
>
> Simon
>
>
> On Wed, Mar 2, 2011 at 10:19 AM, Landon Stewart wrote:
>
>> Hi Simon,
>>
>> In RT_SiteConfig.pm:
>>
>> Set($ParseNewMessageForTicketCcs , 0);
>>
>>
>> On Wed, Mar 2, 2011 at 10:17 AM, Simon Gao wrote:
>>
>>> Hi,
>>>
>>> Is there a way to prevent email addresses on CC list from being added to
>>> RT notification list?
>>>
>>> Simon
>>>
>>
>>
>>
>> --
>> Landon Stewart 
>> SuperbHosting.Net by Superb Internet Corp.
>> Toll Free (US/Canada): 888-354-6128 x 4199
>> Direct: 206-438-5879
>> Web hosting and more "Ahead of the Rest": http://www.superbhosting.net
>>
>
>


-- 
Landon Stewart 
SuperbHosting.Net by Superb Internet Corp.
Toll Free (US/Canada): 888-354-6128 x 4199
Direct: 206-438-5879
Web hosting and more "Ahead of the Rest": http://www.superbhosting.net


[rt-users] As root I cannot remove a watcher from a queue -

2011-08-12 Thread Landon Stewart
*To replicate this issue:*
Configuration -> Queues ->  -> Watchers -> Check the box next to
the group (Systems) -> Save Changes

*Results *

   - Could not remove that principal as a Cc for this queue

The log file at /opt/rt3/var/log/rt.log says:
[Fri Aug 12 21:13:21 2011] [warning]: User not loaded.
(/opt/rt3/bin/../lib/RT/User_Overlay.pm:1490)
[Fri Aug 12 21:13:21 2011] [warning]: Unable to revoke delegated rights for
principal 2746 (/opt/rt3/bin/../lib/RT/GroupMember_Overlay.pm:342)
[Fri Aug 12 21:13:21 2011] [error]: Failed to delete 44 as a member of group
28: Member not deleted (/opt/rt3/bin/../lib/RT/Queue_Overlay.pm:955)

I've tried this every way I can think of.  I even specifically granted a
user with ModifyQueueWatchers for that queue and tried that.  It doesn't
work.

I found a two discussions about this but neither of them were conclusive:
- http://lists.fsck.com/pipermail/rt-users/2011-March/069477.html
- http://www.gossamer-threads.com/lists/rt/users/100612

The SuperUser (root) should not have a problem doing this.  The "User not
loaded" error in the logs confuses me as well.  I checked to make sure that
all the users within the group called 'Systems' actually exist and are
granted rights.  Not sure what user its talking about in that error
message.  The Systems user is a Watcher for both CC and AdminCC (I don't
know why someone set it to both, but I want to remove it from at least one
of those if not both).

Thanks for reading and in advance for any help anyone can provide.

-- 
Landon Stewart 
SuperbHosting.Net by Superb Internet Corp.
Toll Free (US/Canada): 888-354-6128 x 4199
Direct: 206-438-5879
Web hosting and more "Ahead of the Rest": http://www.superbhosting.net

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA — September 26 & 27, 2011
*  San Francisco, CA, USA — October 18 & 19, 2011
*  Washington DC, USA — October 31 & November 1, 2011
*  Melbourne VIC, Australia — November 28 & 29, 2011
*  Barcelona, Spain — November 28 & 29, 2011

Re: [rt-users] As root I cannot remove a watcher from a queue -

2011-08-14 Thread Landon Stewart
Thanks Ruslan for your reply.

I did attempt an upgrade to 4.0 but reverted to a prior database copy after
the upgrade failed.  The issues on the upgrade are moot at this point.

After checking for those entries should I ensure they are zero or NULL or
make sure they are not zero or NULL?

On 14 August 2011 14:20, Ruslan Zakirov  wrote:

> Hi,
>
> Last time I looked into such error it was a problem with revoking
> delegated rights. RT 4.0 drops support for personal groups and
> delegations. I recommend you to walk through ACL table and check all
> records where Delegated* columns are not zero or NULL.
>
> If you don't have delegated rights then it's something else.
>
> Other idea is inconsistent database. Use rt-validator in recent 3.8
> releases to check consistency.
>
> On Sat, Aug 13, 2011 at 1:20 AM, Landon Stewart 
> wrote:
> > To replicate this issue:
> > Configuration -> Queues ->  -> Watchers -> Check the box next
> to
> > the group (Systems) -> Save Changes
> >
> > Results
> >
> > Could not remove that principal as a Cc for this queue
> >
> > The log file at /opt/rt3/var/log/rt.log says:
> > [Fri Aug 12 21:13:21 2011] [warning]: User not loaded.
> > (/opt/rt3/bin/../lib/RT/User_Overlay.pm:1490)
> > [Fri Aug 12 21:13:21 2011] [warning]: Unable to revoke delegated rights
> for
> > principal 2746 (/opt/rt3/bin/../lib/RT/GroupMember_Overlay.pm:342)
> > [Fri Aug 12 21:13:21 2011] [error]: Failed to delete 44 as a member of
> group
> > 28: Member not deleted (/opt/rt3/bin/../lib/RT/Queue_Overlay.pm:955)
> >
> > I've tried this every way I can think of.  I even specifically granted a
> > user with ModifyQueueWatchers for that queue and tried that.  It doesn't
> > work.
> >
> > I found a two discussions about this but neither of them were conclusive:
> > - http://lists.fsck.com/pipermail/rt-users/2011-March/069477.html
> > - http://www.gossamer-threads.com/lists/rt/users/100612
> >
> > The SuperUser (root) should not have a problem doing this.  The "User not
> > loaded" error in the logs confuses me as well.  I checked to make sure
> that
> > all the users within the group called 'Systems' actually exist and are
> > granted rights.  Not sure what user its talking about in that error
> > message.  The Systems user is a Watcher for both CC and AdminCC (I don't
> > know why someone set it to both, but I want to remove it from at least
> one
> > of those if not both).
> >
> > Thanks for reading and in advance for any help anyone can provide.
> >
> > --
> > Landon Stewart 
> > SuperbHosting.Net by Superb Internet Corp.
> > Toll Free (US/Canada): 888-354-6128 x 4199
> > Direct: 206-438-5879
> > Web hosting and more "Ahead of the Rest": http://www.superbhosting.net
> >
> > 
> > RT Training Sessions (http://bestpractical.com/services/training.html)
> > *  Chicago, IL, USA — September 26 & 27, 2011
> > *  San Francisco, CA, USA — October 18 & 19, 2011
> > *  Washington DC, USA — October 31 & November 1, 2011
> > *  Melbourne VIC, Australia — November 28 & 29, 2011
> > *  Barcelona, Spain — November 28 & 29, 2011
> >
>
>
>
> --
> Best regards, Ruslan.
>



-- 
Landon Stewart 
SuperbHosting.Net by Superb Internet Corp.
Toll Free (US/Canada): 888-354-6128 x 4199
Direct: 206-438-5879
Web hosting and more "Ahead of the Rest": http://www.superbhosting.net

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA — September 26 & 27, 2011
*  San Francisco, CA, USA — October 18 & 19, 2011
*  Washington DC, USA — October 31 & November 1, 2011
*  Melbourne VIC, Australia — November 28 & 29, 2011
*  Barcelona, Spain — November 28 & 29, 2011

Re: [rt-users] As root I cannot remove a watcher from a queue -

2011-08-19 Thread Landon Stewart
On 14 August 2011 14:20, Ruslan Zakirov  wrote:

> Hi,
>
> Last time I looked into such error it was a problem with revoking
> delegated rights. RT 4.0 drops support for personal groups and
> delegations. I recommend you to walk through ACL table and check all
> records where Delegated* columns are not zero or NULL.
>

Seems OK...
mysql> select * from ACL WHERE DelegatedBy != "0" OR DelegatedFrom != "0";
Empty set (0.00 sec)


> If you don't have delegated rights then it's something else.
>
> Other idea is inconsistent database. Use rt-validator in recent 3.8
> releases to check consistency.
>

This did it!

Thanks again Ruslan.

-- 
Landon Stewart 
SuperbHosting.Net by Superb Internet Corp.
Toll Free (US/Canada): 888-354-6128 x 4199
Direct: 206-438-5879
Web hosting and more "Ahead of the Rest": http://www.superbhosting.net

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA — September 26 & 27, 2011
*  San Francisco, CA, USA — October 18 & 19, 2011
*  Washington DC, USA — October 31 & November 1, 2011
*  Melbourne VIC, Australia — November 28 & 29, 2011
*  Barcelona, Spain — November 28 & 29, 2011

Re: [rt-users] rt-mailgate

2012-01-23 Thread Landon Stewart
On 9 January 2012 10:34, Robert Nesius  wrote:

> I made a recently change to how my apache2 server was configured to
> redirect all requests through https.  Now emails are not flowing through to
> RT - I tracked the issue down to rt-mailgate complaining about not being
> able to verify the certificate.  I'm a little perplexed on how to proceed
> or how to verify what certs/CAs rt-mailgate is using, or if there is an
> issue with the Crypt::SSLeay module (which I had to force install due to a
> failing test).   I only have one openssl install on the system, and I
> thought Crypt::SSLeay would reach through to those configs for things like
> CA certs, etc...
>
> Perhaps an easy workaround, since the mail server and apache2 server are
> on the same machine, would be to configure a "localhost:80" virtual host
> within apache2 and bypass SSL when accessing RT via that url.
>
> Any helpful hints/suggestions would be greatly appreciated.   I've been
> google-ing away but haven't had any luck yet.
>
>
We simply use mod_rewrite to redirect everyone *except* the server itself
to https.  This way when rt-mailgate calls http://rt.ourdomain/com it is
not forced to use https while everyone else is.

# Redirect everyone except the rt-mailgate and RT utilities to https
   RewriteEngine On
   RewriteCond %{REMOTE_ADDR} !^10\.10\.227\.209$
   RewriteRule ^/(.*)$ https://rt.ourdomain.com/$1 [R=301,L]

The 10.10.227.209 is the IP address of the server according to ifconfig
eth0 in this case.

-- 
Landon Stewart 
Manager of Systems and Engineering
Superb Internet Corp - 888-354-6128 x 4199
Web hosting and more "Ahead of the Rest": http://www.superbhosting.net

RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston — March 5 & 6, 2012

[rt-users] Replacing the login screen to authenticate with cookies

2010-03-01 Thread Landon Stewart
I've been reading about mason and the use of Apache::Cookie but I really
don't know where to tie any of this into RT.  It's difficult to know what to
change and where the 'right' place is.  I've seen numerous people ask this
same question - where is the best place to change the front-end login page
with something else?  What is required by RT to know a user is
'authenticated' and allowed to be assigned an "RT-SID_..." cookie?

What I'd like to do is, upon visiting the RT URL where the login screen
normal appears, you are redirected to another URL to check and see if you
have 'that' site's cookie set.  If you do that site decides if you are
authenticated or not.  If you are it sends you back to RT.  If RT sees that
cookie set it knows you are logged in.  We have this working on other
internal use systems that are commonly used but are predominantly written in
php, not perl, and certain not using mason.

So I guess I need to know how to replace the login screen in RT and what
needs to be available to RT for it to 'trust' that a user is logged in.  I
know it needs the 'username' that matches a username in RT's database, but
other then that...  I just don't know.  Can I fool RT into not checking a
password if it gets cookie data from a specific referrer and then using that
cookie data to know who it is that we just fooled it into logging in?

(We plan on importing all the user information into the RT user database but
single-sign-on is important to us for transparent movement within our
systems by staff).

-- 
Landon Stewart 
SuperbHosting.Net by Superb Internet Corp.
Toll Free (US/Canada): 888-354-6128 x 4199
Local and International: 206-438-5879 x 4199
Web hosting and more "Ahead of the Rest": http://www.superbhosting.net
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

[rt-users] Most efficient way to update custom fields without creating too many transactions

2013-08-26 Thread Landon Stewart
Hello,

Currently we are utilizing some internal systems to lookup the Customer ID
and other data related to that customer to add to Incident Reports coming
into RT.  Some organizations include a list of IP addresses or URLs related
to a specific type of Incident.  Those IP addresses or URLs might belong to
several customers and the processing of the ticket becomes more arduous to
process by my Action modules.  While this is not a problem in itself
because it eventually does get processed the processing also adds a number
of of Transactions that is multiples of the required custom fields to be
updated.

For example if there are 1000 IP addresses in a ticket and there are 4
custom fields to be updated it creates 4000 transactions for that one
ticket when looping each update individually.

What I'm wondering is if there's a better way to make these updates so
multiple values can be added to the ticket with one transaction.

Example:

*This:*
foreach my $customerID (@customerids) {
  $ticket->AddCustomFieldValue( Field => 'Customer', Value => $customerID );
}

Vs. This:
$ticket->AddCustomFieldValue( Field => 'Customer', Value =>
join("\n",@customerids) );

I noticed the "Content" field in the ObjectCustomFieldValues table is
limited to varchar(255) so the second psudo-code example above would
probably not be a good idea.

ALSO - If anyone has advice on how to split incoming tickets for tons of IP
address into individual tickets please let me know.  I have an idea of how
I'm going to do it already based on some parsing and create perl code but
there's always more than one way to skin a cat.

In fact, having just re-read what I wrote above, I think I might be going
about this incorrectly.  Perhaps I should not be adding ALL the data per
Incident Report but rather per Incident.  I should probably restrict the
data added to the Incident Report to just Customer ID only.  Perhaps the
single report having many IP addresses listed should be linked to a new
Incident per customer instead of creating multiple Incident Reports.  That
actually makes more sense.

Thanks for reading!  Any feedback is appreciated.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] Most efficient way to update custom fields without creating too many transactions

2013-08-27 Thread Landon Stewart
On 27 August 2013 09:27, Kevin Falcone  wrote:

> It'd be safer to use the RecordTransaction argument to
> AddCustomFieldValue which tells RT whether or not to record a
> transaction.
>
> This avoids the problem of directly manipulating OCFVs and potentially
> truncating them when you shove content > 255 into the Content field.
> RT transparently bounces between the Content and LargeContent field as
> needed if you use the API.
>

So, to be clear here, if in my RT::Action::ModuleName action module if I
use something like this:

$Ticket->AddCustomFieldValue( Field => 'Customer', Value =>
join("\n",@customerids), RecordTransaction => 0 );

And if @customerids contained a list of 1000 five or six digit numbers it
would not choke on that many because LargeContent would get used or because
I'm not recording the transaction at all?  Or am I mistaken here somewhere
still?

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] Most efficient way to update custom fields without creating too many transactions

2013-08-30 Thread Landon Stewart
On 29 August 2013 13:31, Kevin Falcone  wrote:

> Because Custom Fields can hold a LONGBLOB worth of data.
>  Go save a large text CF and look in the database.
> Saving them as 1000 individual values makes 1000 records in the
> database, saving them as 1 large record makes 1 record.  These are
> treated differently on update and display.
>
> If you follow the advice of the wiki article that was linked to and
> reach around the API, you'll hurt yourself.
>
> Not recording transactions is orthogonal to the size of the data which
> can be recorded.
>

I'm sorry - I'm pretty sure I'm reading you correctly but I'm unable to add
multiple values to a Custom Field without creating multiple
ObjectCustomFieldValue records.  Maybe it's not possible to do so.

The %Updates hash is a hash of arrays like this (this is one key, I don't
know why Dumper prints it as two VARs):
$VAR11 = 'Customer';
$VAR12 = [
   '1xxx59',
   '1xxx22',
   '1xxx56',
   '1xxx5',
   '6xxx5',
   '1xxx93',
   '6xxx1',
   '4xxx1',
   '2xxx1',
   '3xxx8',
   '6xxx7',
   '1xxx08',
   '1xxx36'
 ];

Here's what I've tried and seen:
foreach my $ufn (keys %Updates) {
$ticket->AddCustomFieldValue( Field => $ufn, Value => join("\n",
@{$Updates{$ufn}}), RecordTransaction => 0 );
}
-- What this does is adds one ObjectCustomFieldValue record with \n between
some stuff.  These are displayed in RT as values with spaces between them.

foreach my $ufn (keys %Updates) {
$ticket->AddCustomFieldValue( Field => $ufn, Value => join(',',
@{$Updates{$ufn}}), RecordTransaction => 0 );
}
-- I didn't think this would really work but I thought I'd try it anyway.
 Same thing but comma delimited.  They are displayed in RT as values with
commas between them.

So in other words I'm starting to think I've been after something that
can't be done.  RecordTransaction => 0 stops the "Transactions" table from
getting a ton of records added to it (one for each OCFV record added) but I
cannot avoid tons of OCFV records being added.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] Most efficient way to update custom fields without creating too many transactions

2013-08-30 Thread Landon Stewart
On 30 August 2013 14:29, Kevin Falcone  wrote:

> If you have a multiple value custom field, then each value will be an
> OCFV.
>
As I wrote above "Go save a large *text* CF and look in the database"
> (added emphasis on text).
>
> It's unclear to me how you think we could store a Custom Field with a
> thousand distinct values as anything other than distinct records in
> the database?
>

I thought it was possible simply because I was asked by someone who has
experience with RT to find out how to do it.

Anyway - thanks for confirming that it's not possible at least.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


[rt-users] Dynamic choice of templates based on the value of a CF

2013-09-06 Thread Landon Stewart
We classify tickets based on content and store that classification as a
string in a CF called CF.{Classification}.  This is an RTIR instance but
that is not really relevant other to say that when we open an Investigation
on an Incident we want the template that is used for the Investigation to
be dynamic based on the value of the CF.{Classification} field.

Currently what I'm doing is I have a Scrip for each Classification with a
condition for that classification as well as the "On Create" condition.
 When each Scrip fires it checks to see if the Investigation is that
Classification.  If it is the template associated with the Scrip is used.
 This is messy because it requires a Scrip for each Classification.

Instead one Scrip for "On Create" that chooses the template dynamically.

What I think I can do is simply have one very short Template that is
basically 100% perl and includes some text from a text file stored on the
file system but outside RTIR.  Which file gets included in the Template is
dependent upon the CF.{Classification}.

ie:
{ require
"/path/to/templates/".$Ticket->FirstCustomFieldValue('Classification').".template";
}

Would this even work?  Is there a better way to choose a Perl template in
the Scrip so that templates can be kept within RT?

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] Dynamic choice of templates based on the value of a CF

2013-09-06 Thread Landon Stewart
On 6 September 2013 11:04, Landon Stewart  wrote:

> What I think I can do is simply have one very short Template that is
> basically 100% perl and includes some text from a text file stored on the
> file system but outside RTIR.  Which file gets included in the Template is
> dependent upon the CF.{Classification}.
>
> ie:
> { require
> "/path/to/templates/".$Ticket->FirstCustomFieldValue('Classification').".template";
>  }
>
>
Actually I believe I found the answer which I'm going to try…  I basically
need a hybrid of these two because we also send different copies of
templates depending on the language the customer prefers to be communicated
with in.

http://requesttracker.wikia.com/wiki/ForkTemplate
http://requesttracker.wikia.com/wiki/ChooseTemplateByUserLang

So - never mind my original post unless you have any information that's
better than the two ones above.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] Dynamic choice of templates based on the value of a CF

2013-09-06 Thread Landon Stewart
On 6 September 2013 11:55, Landon Stewart  wrote:

> Actually I believe I found the answer which I'm going to try…  I basically
> need a hybrid of these two because we also send different copies of
> templates depending on the language the customer prefers to be communicated
> with in.
>
> http://requesttracker.wikia.com/wiki/ForkTemplate
> http://requesttracker.wikia.com/wiki/ChooseTemplateByUserLang
>
> So - never mind my original post unless you have any information that's
> better than the two ones above.
>

Well after trying and trying - none of this has worked because
SetTemplate() is no longer a valid method for Conditions in RT 4.0.17 among
other reasons.

If anyone has any information on how to dynamically set the Template in a
Scrip with RT 4.0.x I would greatly appreciate it!

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


[rt-users] Using RT::Template with MIMEObj to create a new ticket using ->Create()

2013-09-13 Thread Landon Stewart
This was originally posted to the RTIR list but I'm x-posting it here
because it's not specific to RTIR and I'm still having difficulties.

I've been unable to figure out how to call an action module from another
action module but instead I've been working on an action module that
basically:
- gets called on an Incident (and uses the create and correspond
transactions to open a new Investigations ticket)
- attaches the Incident Reports linked to that Incident to the
Investigation…

I have it creating a ticket although I haven't filled in much of the
CustomFields I'll need to I cannot get it to use a template for some
reason.

Specifically the LoadQueueTemplate() and Parse() a bit of a mystery to me.

Example:
$templateObj->LoadQueueTemplate( Queue => "Investigations", Name =>
$classification." (en)" );
my($ret, $msg) = $templateObj->Parse( TicketObj => $new_ticket,
TransactionObj => $self->TransactionObj );

I am building a MIME::Entity above this called $MIMEObj including all the
attachments etc but I don't understand how to get Parse() to to "do
something" to the MIMEObj to get the MIME::Entity->build( Data => … ) to
use the template.  Also the attachments are coming out in-line in the
message instead of attachments but that's probably because the
"RT-Attach-Message: yes" header is in the template that's not being used if
I'm understanding the use of that header correctly.

A more full representation of the code is here:
http://pastebin.com/QF2tbZqH

Thanks to anyone who has an idea of what I'm missing or doing wrong here
and might have some ideas for me.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932

-- 
RT Training in New York, October 8th and 9th: http://bestpractical.com/training

Re: [rt-users] Using RT::Template with MIMEObj to create a new ticket using ->Create()

2013-09-14 Thread Landon Stewart
On 14 September 2013 00:19, Ruslan Zakirov  wrote:

> You should go other way around. After calling $template->Parse you call
> $template->MIMEObj and get MIME::Entity representing result of the
> template. You then can update this entity with attachments, more headers
> and so on.
>

Hi Ruslan,

Thanks for your reply.  I've just tried this but now I'm wondering where I
get the TicketObj and TransactionObj arguments for $template->Parse.  If I
use the Incident's TicketObj and TransactionObj it actually modifies the
Incident's subject.

I cannot put the $new_ticket->Create(…) before the $template->Parse because
RT::Ticket->Create requires a MIMEObj produced by $template->Parse in
$template->MIMEObj.  It's a chicken vs. egg issue here I think.  I must be
missing something but I don't know what.  I also tried putting the "my
$new_ticket = RT::Ticket->new($RT::SystemUser)" above the template but
leave the Create below but I'm still left with no TransactionObj to use
because it's generated by RT::Ticket->Create(…).

I've pasted a new version of my code at http://pastebin.com/UvnUC221.  This
version modifies the subject of the Incident ($self).

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932

-- 
RT Training in New York, October 8th and 9th: http://bestpractical.com/training

Re: [rt-users] Using RT::Template with MIMEObj to create a new ticket using ->Create()

2013-09-16 Thread Landon Stewart
On 14 September 2013 13:19, Ruslan Zakirov  wrote:

> I don't understand your problem here. You have an incident and want to
> create an investigation with a scrip using a template. Templates are used
> here so you don't have to change code every time you to change a word or
> add a new particular text for such investigations.
>
> Here what you do:
>
> 1) scrip is executed when something happens with an Incident, so
> $self->TicketObj is an Incident
> 2) You take Incident's props and use them to generate template name
> 3) You load template and Parse it, providing as much context as possible
> to the template
>
> Here is fun part - RT doesn't care what you pass into template. You can
> probably even skip all arguments and if your template is capable to work
> without arguments then it will work.
>
> 4) Template can have code embedded, so it can use provided context (in
> your case Incident) to fill in dynamic details.
> 5) Template should not change anything, but format some result
> 6) After parsing you get MIMEObj based on existing Incident, IRs, watchers
> of these tickets, CFs, transactions...
> 7) You complete this MIMEObj with additional data and these actions can be
> controlled from templates, for example whether IRs's replies should be
> attached to the Investigation or not can be controlled by 'RTIR-Attach-IRs:
> yes' header (this is exactly what RT does in notification scrips)
> 8) Once MIMEObj is complete you create your investigation ticket
>

Thank you very much for this breakdown of the process.  I've re-worked
things and I'm relying on the Scrip for the Investigations queue that
applies the template to apply it now.  I was trying to do it before hand
thinking that the Scrips would not fire when creating the ticket using a
Scrip/Action module.  Nevertheless it does and a lot of things were cleaned
up and made much easier than I thought they'd be.

Thanks again

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932

-- 
RT Training in New York, October 8th and 9th: http://bestpractical.com/training

Re: [rt-users] Change Queue

2013-09-26 Thread Landon Stewart
On 26 September 2013 10:45, Bryon Baker  wrote:

> Ok tried something on my own I copied "SetPriority.pm" module to
> ChangeQueue.pm and change code to
>
> When I try and execute this with rt-crontool I get
>
> [Thu Sep 26 17:39:21 2013] [critical]: Failed to load module
> RT::Action::ChangeQueue. () at /usr/bin/rt-crontool line 305.
> (/usr/lib/perl5/vendor_perl/5.16.2/RT.pm:400)
> Failed to load module RT::Action::ChangeQueue. () at /usr/bin/rt-crontool
> line 305.
>
> I have compared the permissions on both file and everything looks the same.
>
> package RT::Action::ChangeQueue;
> use base 'RT::Action';
>
> use strict;
> use warnings;
>
> #Do what we need to do and send it out.
>
> #What does this type of Action does
>
> sub Describe  {
>   my $self = shift;
>   return (ref $self . " will set a ticket's priority to the argument
> provided.");
>

That looks weird…  ref $self?  That'd probably return "HASH will set
ticket's…" or something.  I'd nuke it entirely anyway since you don't need
this sub.


> sub Prepare  {
> # nothing to prepare
> return 1;
> }
>

Nuke this since you don't need it.


> sub Commit {
> my $self = shift;
> my $currentqueue = $*ticket*->Queue;
>

You haven't dereferenced $self->TicketObj into $ticket yet above.


> ##  Did this to validate what is happening before I do it.
> print "Current Queue $currentqueue, New Queue *$self->Argument*\n";
> #$self->TicketObj->SetQueue($self->Argument);
>
> }
>

This print line would be interpreted as:
print "Current Queue ".$currentqueue.", New Queue ".$self."->Argument\n";

Probably not what you want…

*By the way there might already be an action called SetQueue.pm in your
lib/RT/Actions/ directory.*

If you want to keep working on your module though - try this.
 This ChangeQueue.pm should be located in /opt/rt4/lib/RT/Action/ or
equivalent.  I've removed SetQueue() like you did so it won't actually
modify the ticket.

package RT::Action::ChangeQueue;
use base 'RT::Action';

use strict;
use warnings;

sub Commit {
my $self = shift;
my $ticket = $self->TicketObj;
my $cq = $ticket->Queue;
my $nq = $self->Argument;

print "Current Queue $cq, New Queue $nq\n";
# or
print "Current Queue ".$self->TicketObj->Queue.", New Queue
".$self->Argument."\n";
# or
print "Current Queue ".$ticket->Queue.", New Queue
".$self->Argument."\n";
}

RT::Base->_ImportOverlays();

1;

Give this line a new Queue ID# and a ticket # and watch the magic:
/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL --action
RT::Action::ChangeQueue --action-arg "" --transaction first --verbose
--search-arg 'id = '


-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932

-- 
RT Training in New York, October 8th and 9th: http://bestpractical.com/training

Re: [rt-users] rt-crontool

2013-09-27 Thread Landon Stewart
On 27 September 2013 11:17, Bryon Baker  wrote:

>  Has anyone setup a rt-crontool job to run a scrip that is defined in a
> queue?
>
> Maybe I will try and explain some more.
>
> So I have built 80 scrips attached to a queue they do several thing for
> filling out custom fields.  But sometime they are not able to retrieve the
> information usually because there is something wrong with the data being
> retrieved from a foreign database.  I get the data corrected but then the
> cf need to be updated manually.
>
> My thought is to rerun the needed scrip to fill in the cf’s.
>

Hi Byron,

I'm doing this in numerous cases.  Basically I use my action modules in the
Scrips but I don't write User Defined actions in the Scrips if I want to be
able to use them as Actions like you are talking about above.  I started
here a few months ago:
http://requesttracker.wikia.com/wiki/WriteCustomAction

Basically the process is to write it as an action in your RT/Action/
directory, test it and stuff…  Once you know it works manually with
rt-crontool then add it to the RT database as a ScripAction so it can be
used in the Scrips section of the UI as well as by rt-crontool.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932

-- 
RT Training in New York, October 8th and 9th: http://bestpractical.com/training

[rt-users] Back to my Dynamic template choosing Scrip problem...

2013-10-02 Thread Landon Stewart
Hello,

This is not an easy issue to work out - I'm sorry for repeating this
question but last time I answered myself and then realized the answer
wasn't going to work out.  Anyway here goes...

I have a CF called "Classification" where we classify a ticket based on a
scoring system for keywords in fields like From:, Subject: and Content of
an incoming email report.  The incident report might be classified as one
of "Phishing", "Open Recursive DNS" or "Malware" etc.  There are currently
12 different classifications and more may need to be added.  When opening
an Investigation for an issue the CF "Classification" is used to determine
the template to send to the client containing some helpful information and
what is required of them.

Not only are we dealing with multiple templates but also each one has its
own language.  English, French and Spanish.  It is very cumbersome to have
3 Scrips for each classification.

*Below is 1 example for the "Open Recursive DNS" classification in all
three languages and how it is dealt with currently:*

*Desc:* On Create Customer Open Recursive DNS English
*Condition:* User Defined
*Action:* Autoreply To Requestor
*Template:* Open Recursive DNS (en)
*Stage:* TransactionCreate
*Custom Condition:*
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
return 0 unless $trans->Type eq "Create";
return 0 unless $ticket->FirstCustomFieldValue('Classification') eq "Open
Recursive DNS";
## If English or no language choose English below...
if ($ticket->FirstCustomFieldValue('PreferredLanguage') eq 'English' ||
$ticket->FirstCustomFieldValue('PreferredLanguage') eq "") {

return 1;
}

*Desc:* On Create Customer Open Recursive DNS French
*Condition:* User Defined
*Action:* Autoreply To Requestor
*Template:* Open Recursive DNS (fr)
*Stage:* TransactionCreate
*Custom Condition:*
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
return 0 unless $trans->Type eq "Create";
return 0 unless $ticket->FirstCustomFieldValue('Classification') eq "Open
Recursive DNS";
if ($ticket->FirstCustomFieldValue('PreferredLanguage') eq 'French') {
return 1;
}

*Desc:* On Create Customer Open Recursive DNS Spanish
*Condition:* User Defined
*Action:* Autoreply To Requestor
*Template:* Open Recursive DNS (es)
*Stage:* TransactionCreate
*Custom Condition:*
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
return 0 unless $trans->Type eq "Create";
return 0 unless $ticket->FirstCustomFieldValue('Classification') eq "Open
Recursive DNS";
if ($ticket->FirstCustomFieldValue('PreferredLanguage') eq 'Spanish') {
return 1;
}

"OK!?  So what's the problem?" you might ask…

Can anyone tell me how to roll this into one Scrip without making the
templates themselves a mess of spaghetti code?

*Pseudo code might be:*
*Desc:* On Create Customer Open Recursive DNS
*Condition:* User Defined
*Action:* Autoreply To Requestor
*Template:* Global template: Blank
*Stage:* TransactionCreate
*Fake Code Custom Condition:*
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
return 0 unless $trans->Type eq "Create";
my $class = $self->FirstCustomFieldValue('Classification');
my $lang = $ticket->FirstCustomFieldValue('PreferredLanguage');
my $template = $class." (".$lang.")";
## Eg: Open Recursive DNS (French)
if (SetTheTemplateTo($template)) {
  return 1;
}
return 0;

I know SetTheTemplateTo() is not a real function… But that's what I want to
work out how to do.  Basically override or supplement the template set on
the Scrip form.


-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932

-- 
RT Training in New York, October 8th and 9th: http://bestpractical.com/training

Re: [rt-users] Back to my Dynamic template choosing Scrip problem...

2013-10-04 Thread Landon Stewart
Hi Ruslan,

Firstly, thank you!  This worked remarkably well.  I customized things a
little to have it not be used unless it's the right type of notification
etc but otherwise it was pretty much right on and works well.  My Scrips
are all now deleted and there's just one in there now for this purpose and
the template is properly selected based on the criteria used to make the
$name variable.

I have one question however…  What is the reason for the foreach loop in
this code you provided.





On 3 October 2013 04:27, Ruslan Zakirov  wrote:

> Hi,
>
> You can do this by inserting custom TemplateObj method into
> RT/Action/SendMail.pm
>
> It should be like this:
> 1) behave like original method, so copy it from lib/RT/Action.pm
> 2) change template on call when Ticket and Txn are available
> 3) mark that change was done
>
> For example:
>
> sub TemplateObj {
> my $self = shift;
> return $self->{TemplateObj} if !$self->{TemplateObj}
> || $self->{our_custom_code_has_made_the_change};
>
> my $ticket = $self->TicketObj;
> return $self->{TemplateObj} unless $ticket;
>
> my $orig_name = $self->{TemplateObj}->Name;
>
> my $lang = $ticket->FirstCustomFieldValue('Language');
> my $case_type = $ticket->FirstCustomFieldValue('Category');
> foreach my $name ("$orig_name $case_type $lang", "$orig_name
> $case_type $lang") {
>  my $tmp = RT::Template->new( $self->CurrentUser );
>  $tmp->Load( $name ); # queue should be here and fallback to
> global!
>  unless ($tmp->id) {
>  RT->Logger->debug("No custom template $name");
>  } else {
>  $self->{TemplateObj} = $tmp;
>  }
> }
> $self->{our_custom_code_has_made_the_change} = 1;
> return $self->{TemplateObj};
> }
>
>
> Note that the code is not tested in any way, just typed it in mail client.
>
>
> On Thu, Oct 3, 2013 at 12:59 AM, Landon Stewart  wrote:
>
>> Hello,
>>
>> This is not an easy issue to work out - I'm sorry for repeating this
>> question but last time I answered myself and then realized the answer
>> wasn't going to work out.  Anyway here goes...
>>
>> I have a CF called "Classification" where we classify a ticket based on a
>> scoring system for keywords in fields like From:, Subject: and Content of
>> an incoming email report.  The incident report might be classified as one
>> of "Phishing", "Open Recursive DNS" or "Malware" etc.  There are currently
>> 12 different classifications and more may need to be added.  When opening
>> an Investigation for an issue the CF "Classification" is used to determine
>> the template to send to the client containing some helpful information and
>> what is required of them.
>>
>> Not only are we dealing with multiple templates but also each one has its
>> own language.  English, French and Spanish.  It is very cumbersome to have
>> 3 Scrips for each classification.
>>
>> *Below is 1 example for the "Open Recursive DNS" classification in all
>> three languages and how it is dealt with currently:*
>>
>> *Desc:* On Create Customer Open Recursive DNS English
>> *Condition:* User Defined
>> *Action:* Autoreply To Requestor
>> *Template:* Open Recursive DNS (en)
>> *Stage:* TransactionCreate
>> *Custom Condition:*
>> my $trans = $self->TransactionObj;
>> my $ticket = $self->TicketObj;
>> return 0 unless $trans->Type eq "Create";
>> return 0 unless $ticket->FirstCustomFieldValue('Classification') eq "Open
>> Recursive DNS";
>> ## If English or no language choose English below...
>> if ($ticket->FirstCustomFieldValue('PreferredLanguage') eq 'English' ||
>> $ticket->FirstCustomFieldValue('PreferredLanguage') eq "") {
>>
>> return 1;
>> }
>>
>> *Desc:* On Create Customer Open Recursive DNS French
>> *Condition:* User Defined
>> *Action:* Autoreply To Requestor
>> *Template:* Open Recursive DNS (fr)
>> *Stage:* TransactionCreate
>> *Custom Condition:*
>> my $trans = $self->TransactionObj;
>> my $ticket = $self->TicketObj;
>> return 0 unless $trans->Type eq "Create";
>> return 0 unless $ticket->FirstCustomFieldValue('Classification') eq "Open
>> Recursive DNS";
>> if ($ticket->FirstCustomFieldValue('PreferredLanguage') eq 'French') {
>> retu

Re: [rt-users] Back to my Dynamic template choosing Scrip problem...

2013-10-07 Thread Landon Stewart
>
> On 3 October 2013 04:27, Ruslan Zakirov  wrote:
>
>> Hi,
>>
>> You can do this by inserting custom TemplateObj method into
>> RT/Action/SendMail.pm
>>
>> It should be like this:
>> 1) behave like original method, so copy it from lib/RT/Action.pm
>> 2) change template on call when Ticket and Txn are available
>> 3) mark that change was done
>>
>> For example:
>>
>> sub TemplateObj {
>> my $self = shift;
>> return $self->{TemplateObj} if !$self->{TemplateObj}
>> || $self->{our_custom_code_has_made_the_change};
>>
>> my $ticket = $self->TicketObj;
>> return $self->{TemplateObj} unless $ticket;
>>
>> my $orig_name = $self->{TemplateObj}->Name;
>>
>> my $lang = $ticket->FirstCustomFieldValue('Language');
>> my $case_type = $ticket->FirstCustomFieldValue('Category');
>> foreach my $name ("$orig_name $case_type $lang", "$orig_name
>> $case_type $lang") {
>>  my $tmp = RT::Template->new( $self->CurrentUser );
>>  $tmp->Load( $name ); # queue should be here and fallback to
>> global!
>>  unless ($tmp->id) {
>>      RT->Logger->debug("No custom template $name");
>>  } else {
>>  $self->{TemplateObj} = $tmp;
>>  }
>> }
>> $self->{our_custom_code_has_made_the_change} = 1;
>> return $self->{TemplateObj};
>> }
>>
>> On 4 October 2013 11:47, Landon Stewart  wrote:

> Hi Ruslan,
>
> Firstly, thank you!  This worked remarkably well.  I customized things a
> little to have it not be used unless it's the right type of notification
> etc but otherwise it was pretty much right on and works well.  My Scrips
> are all now deleted and there's just one in there now for this purpose and
> the template is properly selected based on the criteria used to make the
> $name variable.
>
> I have one question however…  What is the reason for the foreach loop in
> this code you provided.
>

One update to this…  I had to add a line to stop the sub from overriding if
the TransactionObj->Type is not Create

my $ticket = $self->TicketObj;
return $self->{TemplateObj} unless $ticket;
*return $self->{TemplateObj} unless $trans->Type eq "Create";*

Without this the template is overridden on correspondence as well.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932

-- 
RT Training in New York, October 8th and 9th: http://bestpractical.com/training

Re: [rt-users] Back to my Dynamic template choosing Scrip problem...

2013-10-07 Thread Landon Stewart
On 7 October 2013 12:43, Ruslan Zakirov  wrote:

> Typo in my code made it less clear, it should have been:
>
> foreach my $name ("$orig_name $case_type $lang", "$orig_name $lang" ) {
> ...
> }
>
> Idea is to look first for template with more detailed name, then look for
> name without case type, but language specific, then fallback to default in
> case all are absent.
>

Oh that makes complete sense now.  Thanks again.


-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932

-- 
RT Training in New York, October 8th and 9th: http://bestpractical.com/training

Re: [rt-users] Custom Field - Yes / No Option

2013-10-11 Thread Landon Stewart
On 11 October 2013 03:54, globo  wrote:

> Hi,
>
> I am trying to create a custom field with Yes / No options.
>
> If Yes is selected the custom Field would load a template and No won't load
> the template.
>
> I am using the following code in my script under Custom Condition
>
> Condition: User Defined
>
> $self->TicketObj->FirstCustomFieldValue("Custom Field Name") ne "Yes")
>
> I'm not a programmer so I am struggling to figure how to get this working.


In RT most of these things have to return something so RT knows something
was done or knows the condition is true.  This is true for conditions and
actions.

For the condition:
return 0 unless $self->TicketObj->FirstCustomFieldValue("Custom Field
Name") eq "Yes";
return 0 unless $self->TicketObj->FirstCustomFieldValue("Custom Field
Name") ne "";
return 1;

Or just simply a one liner (functionally the same as above):
return 1 if $self->TicketObj->FirstCustomFieldValue("Custom Field Name") eq
"Yes";

It'll return zero unless that custom field is set to Yes (case matters in
both examples).

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] How Do i get rt-crontool working?

2013-10-31 Thread Landon Stewart
On 31 October 2013 09:09, Kipruto Matthew  wrote:

> hey pliz help. i want the rt to be sending mails  when tickeks have stayed
> for sometime e.g 2days. how do i set it in crontab?
>

It would be helpful if you could provide some real world examples of what
you are trying to do and what is happening rather than what you expect.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] Tracking and Reporting Reopened Tickets

2013-11-04 Thread Landon Stewart
Hi Aaron,

Scroll down on this page until you get to 'on status change from “new”
to “open”’

http://requesttracker.wikia.com/wiki/CustomConditionSnippets

Although I’m not clear what “First Time Fix” actually means to your
organization a simple scrip could modify a custom field from empty to
“First Time Fix” or something using that condition when it happens.



On 4 November 2013 09:50, Shuford, Aaron  wrote:
> Hello,
>
> I am currently working on implementing a ticketing system for our store to
> support warranty repairs on Apple products.  To do this, we need to
> periodically send in reports to Apple.
>
> One of the things we need to report on is the “First Time Fix”.  My plan was
> to track tickets that have been reopened (i.e. Resolved to Open)  I’ve been
> Googling and searching the wiki and the Mailing list for the past few days.
> The closest I found were some that would track custom tickets or the
> OnStatusChange script. In the Wiki.
>
> Unfortunately I am not much of a programmer so I couldn’t tell what the best
> way to adapting these scripts would be.  Any ideas?
>
> Thanks
>
> AaronS.
>
>
>



-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] RT4.2 with Ubuntu13.10 and Postfix

2013-11-12 Thread Landon Stewart
On 12 November 2013 16:03, mmahoney  wrote:

>
> 
> root@RTv4:/opt/rt4/etc# cat /etc/aliases
> # See man 5 aliases for format
> #postmaster:root
> rt4ticket: "|/opt/rt4/bin/rt-mailgate --queue General --action correspond
> --url https://rtv4.nhsocal.com/";
> rt4comment: "|/opt/rt4/bin/rt-mailgate --queue General --action comment
> --url https://rtv4.nhsocal.com/";
>
>
Is --url https://rtv4.nhsocal.com/"; really on a separate line in this file?
If so it should not be.  Is /etc/aliases the right file?  Check main.cf for
postfix and check and see what is defined for the alias_maps file.  Also -
If alias_maps is defined as a hash in your postfix main.cf file you must
rebuild it. Example:
Under Ubuntu you can use "newaliases" to rebuild the the aliases.db file
with the file specified as the alias_maps file as the source.

You might want to check this out:
https://help.ubuntu.com/community/PostfixBasicSetupHowto#Local_Alias_database

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] RT4.2 with Ubuntu13.10 and Postfix

2013-11-12 Thread Landon Stewart
Check logs and look for bounces.

On Tuesday, November 12, 2013, mmahoney wrote:

> Thanks for the prompt response. I think the copy/paste wrapped. I verified
> the aliases as a single line.
>
> I also cp /etc/aliases /etc/postfix/aliases
> Ran postalias /etc/aliases to create the aliases.db
> modified the main.cf
>
> myhostname = rtv4.nhsocal.com
> *alias_maps = hash:/etc/postfix/aliases
> alias_database = hash:/etc/postfix/aliases.db*
> myorigin = /etc/mailname
> mydestination = rtv4.nhsocal.com, localhost.nhsocal.com, localhost
> relayhost = 10.10.1.37
> mynetworks = 127.0.0.0/8 [:::127.0.0.0]/104 [::1]/128
> #mainbox_command = procmail -a "$EXTENSION"
> #mailbox_size_limit = 0
> #recipient_delimiter = +
> #inet_interfaces = all
>
> I will try the virtual thing, but it is a little over my head.
>
>
>
>
> --
> View this message in context:
> http://requesttracker.8502.n7.nabble.com/RT4-2-with-Ubuntu13-10-and-Postfix-tp55783p55786.html
> Sent from the Request Tracker - User mailing list archive at Nabble.com.
>
>

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] RT4.2 with Ubuntu13.10 and Postfix

2013-11-13 Thread Landon Stewart
Open http and then use mod_rewrite for connections to http from everyone
else other than localhost to hit https then tell aliases to use http.

On Tuesday, November 12, 2013, mmahoney wrote:

> S the firewall was on... ufw allow 25 fixed that which got me closer.
> But
> now the HTTP"s" is failing because of the certificate.
>
> Nov 12 21:08:44 RTv4 postfix/local[6445]: 908C7480ECE:
> to=>, relay=local, delay=0.32,
> delays=0.04/0.02/0/0.26, dsn=4.3.0, status=deferred (temporary failure.
> Command output: HTTP request failed: 500 Can't connect to
> rtv4.nhsocal.com:443 (certificate verify failed). Your webserver logs may
> have more information or there may be a network problem. )
>
>
> Ugh.. checking on that.
>
>
>
> --
> View this message in context:
> http://requesttracker.8502.n7.nabble.com/RT4-2-with-Ubuntu13-10-and-Postfix-tp55783p55788.html
> Sent from the Request Tracker - User mailing list archive at Nabble.com.
>
>

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


[rt-users] What’s the correct SQL syntax for a date/time custom field that’s not set?

2013-11-20 Thread Landon Stewart
Hello,

Basically I want to find tickets with rt-crontool that match the following:
Queue = 'Blocks’ AND Status != ‘removed’ AND CF.{ServerClosed} < ’now'

The problemI’m encountering, although minor, is that it lists tickets that
match that as well as tickets that have no date set whatsoever.  The
rt-crontool utility displays the date as '1970-01-01 00:00:00’ when I
include CF.{ServerClosed} in the -f part of rt-crontool so I thought I’d
use that as part of the query.  I’ve tried variations on “IS NOT NULL” as
!= ‘’ and != ‘0’ as well.  They act the same as “IS NOT NULL”.

*This does not return the expected results which is very puzzling:*
# /opt/rt4/bin/rt ls "Queue = 'Blocks' AND Status != 'removed' AND
CF.{ServerClosed} < 'now' AND CF.{ServerClosed} IS NOT NULL" -f
'id,CF.{ServerClosed}'
*id CF.{ServerClosed}*
xx454020 1970-01-01 00:00:00
xx478114 1970-01-01 00:00:00
xx489293 1970-01-01 00:00:00
xx489299 1970-01-01 00:00:00
xx492598 1970-01-01 00:00:00
xx495471 1970-01-01 00:00:00
xx495481 1970-01-01 00:00:00
xx506972 1970-01-01 00:00:00
xx518388 1970-01-01 00:00:00
xx519494 2013-11-20 05:00:00
xx525723 1970-01-01 00:00:00
xx525730 1970-01-01 00:00:00
xx525787 1970-01-01 00:00:00
xx528536 1970-01-01 00:00:00
xx528542 1970-01-01 00:00:00
xx530465 1970-01-01 00:00:00
xx532486 1970-01-01 00:00:00
xx532492 1970-01-01 00:00:00
xx532556 1970-01-01 00:00:00
xx532595 1970-01-01 00:00:00
xx533669 1970-01-01 00:00:00

*Either does this which is even more puzzling considering the output above:*
# /opt/rt4/bin/rt ls "Queue = 'Blocks' AND Status != 'removed' AND
CF.{ServerClosed} < 'now' AND CF.{ServerClosed} != '1970-01-01 00:00:00'"
-f 'id,CF.{ServerClosed}'
*id CF.{ServerClosed}*
xx454020 1970-01-01 00:00:00
xx478114 1970-01-01 00:00:00
xx489293 1970-01-01 00:00:00
xx489299 1970-01-01 00:00:00
xx492598 1970-01-01 00:00:00
xx495471 1970-01-01 00:00:00
xx495481 1970-01-01 00:00:00
xx506972 1970-01-01 00:00:00
xx518388 1970-01-01 00:00:00
xx519494 2013-11-20 05:00:00
xx525723 1970-01-01 00:00:00
xx525730 1970-01-01 00:00:00
xx525787 1970-01-01 00:00:00
xx528536 1970-01-01 00:00:00
xx528542 1970-01-01 00:00:00
xx530465 1970-01-01 00:00:00
xx532486 1970-01-01 00:00:00
xx532492 1970-01-01 00:00:00
xx532556 1970-01-01 00:00:00
xx532595 1970-01-01 00:00:00

xx533669 1970-01-01 00:00:00

*I *can* find tickets where the value is set by doing this though:*
# /opt/rt4/bin/rt ls "Queue = 'Blocks' AND Status != 'removed' AND
CF.{ServerClosed} < 'now' AND CF.{ServerClosed} > '1970-01-01 00:00:00'" -f
'id,CF.{ServerClosed}'
*id CF.{ServerClosed}*
xx519494 2013-11-20 05:00:00

Is using > "1970-01-01 00:00:00” the only way?  Seems like that definite
value might be begging for bugs or something if somehow the unset date
equals "1970-01-01 0*5*:00:00” for some reason down the road.  I just want
to make sure I’m not setting myself up for buggy behaviour in the future.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] What’s the correct SQL syntax for a date/time custom field that’s not set?

2013-11-20 Thread Landon Stewart
On 20 November 2013 11:29, Alex Vandiver  wrote:

> On Wed, 2013-11-20 at 11:13 -0800, Landon Stewart wrote:
>
> > Is using > "1970-01-01 00:00:00” the only way?
>
> Currently, yes.
>

Ok thank you.


> > Seems like that definite value might be begging for bugs or something
> > if somehow the unset date equals "1970-01-01 05:00:00” for some reason
> > down the road.  I just want to make sure I’m not setting myself up for
> > buggy behaviour in the future.
>
> That magic date is the "UNIX epoch," and will not change.
>  - Alex
>

Oh I knew it was the Unix epoch date/time but I was concerned that maybe if
the server’s timezone changed it could somehow offset the epoch.  I guess
since that’s simply the ‘display’ version of null then it’s safe to use it
as a constant.

Anyway thanks again.


-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


[rt-users] Datetime customfield’s values not being stored in ticket created with RT::Ticket

2013-11-26 Thread Landon Stewart
Hello,

Basically I’m successfully creating a ticket where a bunch of other
CustomFields are set properly except these two Datetime customfields.  The
CFs apply to all applicable queues and are type “Select datetime”.  I’ve
simplified the ->Create() below a little but generally this is working
perfectly *except* for the CustomerCreated and ServerCreated fields.  The
new ticket in the “Investigations" queue does not have values for those
(totally unset).

my ($newinvid, $newinvTransObj, $inverrorMsg) =
$new_investigation->Create(
 'Queue'  => "Investigations",
'Subject' => $self->TransactionObj->Subject,
 'Status' => 'open',
 'CustomField-83' => 'Customer Notification',
   'MemberOf' => $IncidentObj->id,
   'Priority' => $IncidentObj->Priority,
 'CustomField-65' =>
$IncidentObj->FirstCustomFieldValue('Classification'),
 'CustomField-75' =>
$IncidentObj->FirstCustomFieldValue('Customer'),
 'CustomField-77' =>
$IncidentObj->FirstCustomFieldValue('Email'),
 'CustomField-78' =>
$IncidentObj->FirstCustomFieldValue('CustomerCreated'),
 'CustomField-79' =>
$IncidentObj->FirstCustomFieldValue('ServerCreated'),
 'CustomField-81' =>
$IncidentObj->FirstCustomFieldValue('PreferredLanguage'),
 'CustomField-86' =>
$IncidentObj->FirstCustomFieldValue('CCName'),
 'CustomField-87' =>
$IncidentObj->FirstCustomFieldValue('TechEmail'),
 'CustomField-88' =>
$IncidentObj->FirstCustomFieldValue('ClientName'),
 'CustomField-91' =>
$IncidentObj->FirstCustomFieldValue('ClientGroups'),
 'CustomField-92' =>
$IncidentObj->FirstCustomFieldValue('ProductPrice'),
'CustomField-104' =>
$IncidentObj->FirstCustomFieldValue('ServerType'),
'CustomField-105' =>
$IncidentObj->FirstCustomFieldValue('OperatingSystem'),
'MIMEObj' => $InvMIMEObj,
);

Do they have to be converted to RT::Date objects or even as far as AsString
to be used as the value?

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


[rt-users] Looking for flattened ticket data - De-normalized RT Views originally by Kenneth Crocker KFCrocker at lbl.gov

2013-12-11 Thread Landon Stewart
Hello,

Hopefully Kenneth Crocker is still on the mailing list since he originally
posted about this in 2009.  I’ve been digging around for a way to have a
flattened representation of ticket data including customfields for
statistical purposes.

I think what it is I’m looking for is a to use MySQL Views (stored queries
that when invoked produce a result set and act as a virtual table) but I
can’t figure out how to build one that includes CustomField data from the
ObjectCustomFieldValues table with proper names of fields instead of
numbers and Usernames instead of UIDs etc…  I find the joins required for
the RT data a little extreme to figure out in my head.

I know it’s a complex thing to do but it would make generating statistics
and digging through the data very easy without having to code something in
perl from scratch every time a new statistical report is requested.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] How to create a new condition through the web gui

2013-12-17 Thread Landon Stewart
On 17 December 2013 11:19, Kevin Falcone  wrote:

> You may find it easier to use the new extension we blogged about,
>  instead of User Defined scrips/actions
>
>
> http://blog.bestpractical.com/2013/12/new-web-ui-for-rt-actions-and-conditions.html


Ooooh shiny.  I’m going to add this soon.  Thanks Kevin!

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] any page showing a user drop down in a ticket is loading slow

2013-12-17 Thread Landon Stewart
On 17 December 2013 11:53, Adam Hobaugh  wrote:

> Hello,
>
> I just updated from 4.0.10 to 4.2.1 and it seems to be working well except
> when I am in a ticket, any page that shows a user drop down, ie display and
> people load incredible slowly. I enabled slow query logging and below are
> the two queries that appear to be causing the problem. I appreciate any
> help in resolving this. 10 second load times is rough. Please let me know
> what further information is needed.
>


Hi Adam,

I’m not sure if this applies but we had this issue and it was an RT ACL
issue.  I remember that it was an issue with granting or not-granting
rights to special groups "Everyone" or “Unprivileged” but the details of
which I cannot recall exactly.  I do remember there were large ACL joins in
the database whenever we would try to load pages with these drop downs just
like you’ve described in your post.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] any page showing a user drop down in a ticket is loading slow

2013-12-17 Thread Landon Stewart
On 17 December 2013 13:19, Adam Hobaugh  wrote:

>  Hi Adam,
>
>  I’m not sure if this applies but we had this issue and it was an RT ACL
> issue.  I remember that it was an issue with granting or not-granting
> rights to special groups "Everyone" or “Unprivileged” but the details of
> which I cannot recall exactly.  I do remember there were large ACL joins in
> the database whenever we would try to load pages with these drop downs just
> like you’ve described in your post.
>
>Hello Landon,
>
> I removed the rights from Everyone and we had nothing on Unprivileged and
> I still see the issue. Thanks for the suggestion though.
>

Maybe you need to go the other way with it and grant something?  Maybe you
need to grant some simple rights for showing users or something to
Privileged.  I just checked ours and I have “Privileged” under “General
Rights” allowed to "View custom field values” configured in each queue.  In
the Global -> Group Rights the "View custom fields” is not granted.

I wish I could remember the details of what solved it for us.  I do
remember some things were changed which caused the issue and then had to be
rolled back.  I just don’t recall what was changed that caused it.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] any page showing a user drop down in a ticket is loading slow

2013-12-17 Thread Landon Stewart
On 17 December 2013 13:19, Adam Hobaugh  wrote:

>  Hi Adam,
>
>  I’m not sure if this applies but we had this issue and it was an RT ACL
> issue.  I remember that it was an issue with granting or not-granting
> rights to special groups "Everyone" or “Unprivileged” but the details of
> which I cannot recall exactly.  I do remember there were large ACL joins in
> the database whenever we would try to load pages with these drop downs just
> like you’ve described in your post.
>
>Hello Landon,
>
> I removed the rights from Everyone and we had nothing on Unprivileged and
> I still see the issue. Thanks for the suggestion though.
>

Maybe you need to go the other way with it and grant something?  Maybe you
need to grant some simple rights for showing users or something to
Privileged.  I just checked ours and I have “Privileged” under “General
Rights” allowed to "View custom field values” configured in each queue.  In
the Global -> Group Rights the "View custom fields” is not granted.

I wish I could remember the details of what solved it for us.  I do
remember some things were changed which caused the issue and then had to be
rolled back.  I just don’t recall what was changed that caused it.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] any page showing a user drop down in a ticket is loading slow

2013-12-18 Thread Landon Stewart
On 18 December 2013 10:07, Kevin Falcone  wrote:

> Can you download and run http://mysqltuner.pl on your database.
>

Fun tip.  You can download that with just “wget mysqltuner.pl”.  There’s
some redirection magic that makes it work with just that command.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] RT sending emails on behalf of

2013-12-20 Thread Landon Stewart
On 20 December 2013 13:28, mamir  wrote:

> Hi,
> This is how the email looks like in Outlook sent by RT (4.2.1):
> rt-...@rt-dev.org on behalf of t...@rt-dev.org
> Greetings,
> bla bla bla
>
> Here is my Autoreply template:
> Sender: rt-dev
> Subject: {$Ticket->Subject}
> RT-Attach-Message: yes



How can I get rid of  "rt-...@rt-dev.org on behalf of" so only the

t...@rt-dev.org appears in email.
>

It’s basically how services like Hotmail/Live/Outlook and Gmail alert
people that the email was sent from a mail server that’s not explicitly
authorized to send mail for that domain.  Add SPF and DKIM records for the
sending domain (from domain).

Also…  I’d use these headers instead of the Sender header:

From:  "Some Friendly Name" 
Subject: {$Ticket->Subject}
RT-Attach-Message: yes

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


[rt-users] Triggering two separate templates

2014-01-03 Thread Landon Stewart
Hi Folks,

Currently we have a situation where when a custom field is changed to a
certain value via ticket “edit” a template for that custom field value is
used to correspond with the requestor.  It’s actually a “TERMINATION”
notice telling them they no longer have an account with us.

I’d like to also send an email to other department to have them take an
action as well though.  Basically the customer gets a termination notice
and we want billing to get a request from us to terminate the account.

Does anyone have any ideas on how I’d trigger a second email that the
requestor won’t see?  I thought of just CCing the other department when
that template is used but that’s not really a viable thing to do in this
case.  The other department needs some data from a template that shouldn’t
be sent to the requestor so the emails have to be entirely different.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] Big size of /opt/rt4/var directory

2014-01-06 Thread Landon Stewart
On 5 January 2014 01:31, Ivan Osipov  wrote:

> Hello all.
> I'm using Request Tracker 4.2.1 and Lighttpd (1.4.28-2ubuntu4) via fastcgi
> on Ubuntu 12.04 LTS.
> Now size of "/opt/rt4/var" directory is 5.2 Gb and full backup archive of
> "/opt/rt4/" is very big.
> In this directory a lot of folders with random name:
> ---
> ls -la /opt/rt4/var
> [...]
> drwx--   2 www-data www-data  4096 Dec 30 19:19 xO_kAcCdQA
> drwx--   2 www-data www-data  4096 Dec 30 20:34 xR08jEpXhN
> drwx--   2 www-data www-data  4096 Dec 30 18:21 y2A3tJXMy8
> drwx--   2 www-data www-data  4096 Dec 30 21:01 Y5mPEdMSWh
> drwx--   2 www-data www-data  4096 Dec 30 17:42 yBixm9CtAO
> drwx--   2 www-data www-data  4096 Dec 30 17:41 yeihY9J9VX
> drwx--   2 www-data www-data  4096 Dec 30 22:25 yKjJdoKUNU
> [...]
> ---
> Can I delete all this folders from "/opt/rt4/var"? If yes, how to delete
> this folders automaticaly? This is cache of attachments?


I may be mistaken but to me those look like they might be procmail storing
mail in a directory because it doesn’t know what else to do with them.
 Those shouldn’t be there though so I’d probably first advise that you
resolve that issue before you start using ‘find’ in a crontab to delete
them if they are a certain number of days old or something.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] Using Fetchmail to pipe mail into RT.

2014-01-14 Thread Landon Stewart
On 13 January 2014 16:30, Joshua Riden  wrote:

> Landon,
>
> Thank you so much Landon for your help. I appreciate it a lot! : )
>
> Now just a few questions..
>
> Where is the mailserver log that pertains to fetchmail?
> /var/logs/mailserver ?
>

fetchmail logging has to be turned on like this in .fetchmailrc:

defaults:
  batchlimit 100
  set logfile /home/username/fetchmail.log


>  So when you say I should send  to RT from a real email address, you mean
> from my /etc/aliases file?
>

I mean from a real email address so that bounces will come back to you if
there are any.


> How would I check for bounces that I would receive back?
>

You would check your mail.


> How would I manually pipe the mail into RT ? Is there a command that I can
> use?
>

If you had an email in a file in all its original glory you could pipe it
easily using cat.

# cat emailfile.eml | rt-mailgate

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] Question

2014-01-15 Thread Landon Stewart
I don’t know if that’s even still valid.  I did see this:
http://requesttracker.wikia.com/wiki/RtBounceHandler

We aren’t using that though.  We just handle the straight bounce messages
in their own queue and then process the message content itself to find the
original ticket #.  Unless you have a very high volume of tickets it might
not be worth it to do that but instead set the “-f” for sendmail to
something someone actually receives so they can intervene if a bounce comes
back.


On 15 January 2014 14:35, Bryon Baker  wrote:

>  Thanks for the information
>
>
>
> but where can I download the program rtbouncehandler from?
>
>
>
> Bryon Baker
>
> Network Operations Manager
>
> *Copesan** - Specialists in Pest Solutions*
>
> 800-267-3726  •  262-783-6261 ext. 2296
>
> bba...@copesan.com 
>
> www.copesan.com
>
> *"Servicing North America with Local Care"*
>
>
>
> *From:* Landon Stewart [mailto:lstew...@iweb.com]
> *Sent:* Wednesday, January 15, 2014 3:34 PM
> *To:* Bryon Baker
> *Subject:* Re: [rt-users] Question
>
>
>
> On 15 January 2014 13:13, Bryon Baker  wrote:
>
>  Hello All
>
>
>
> I have a question.
>
>
>
> What happen to the NDR message that come from a forwarded or replied to
> with an invalid email address?
>
>
>
> I cannot find the NDR anywhere.  We are reling through an exchange server.
> On the Suse server I am using postfix to send the message off the Suse
> server.
>
>
>
> Please keep in mind I am not a Linux guru when trying to explain this.
>
>
>
> This thread might answer your question if you are talking about emails
> bouncing that were sent from RT
>
>
>
> http://www.gossamer-threads.com/lists/rt/users/91551
>
>
>
> On a side note - We have “SendmailArguments” in RT’s configuration to
> include ‘-fbounce@’ and then we have a queue for
> bounces.  I wrote a module that looks at the bounces and attributes them to
> the original by ticket # and posts a comment on the original alerting the
> owner that the email bounced and then marks the bounce email ticket
> resolved.
>
>
>
> --
>
> Landon Stewart :: lstew...@iweb.com
>
> Lead Specialist, Abuse and Security Management
> Spécialiste principal, gestion des abus et sécurité
> http://iweb.com :: +1 (888) 909-4932
>
>
>
>
>



-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] Postfix error: 500 No Host option provided

2014-01-16 Thread Landon Stewart
>From the server itself what if execute the following while in an SSH
session (obviously replacing the host.example.com with the correct fqdn of
RT):

curl http://host.example.com

What do you get back?  If you get a 500 error back from that your problem
is not RT related (yet).


On 16 January 2014 12:30, Mathew Snyder  wrote:

> Apologies. I have not been seeing the responses. Checking my spam folder
> did not turn up the emails either.
>
> My aliases file contains two entries. One for rt: and the other for
> rt-comment:
>
> rt:  "|/opt/rt4/bin/rt-mailgate --queue general --action
> correspond --url http://host.example.com";
> rt-comment:"|/opt/rt4/bin/rt-mailgate --queue general --action comment
> --url http://host.example.com";
>
> The web logs don't mention anything about this.
>
> -Mathew
>
> "When you do things right, people won't be sure you've done anything at
> all." - God; Futurama
>
> "We'll get along much better once you accept that you're wrong and
> neither am I." - Me
>
>
> On Thu, Jan 16, 2014 at 5:36 AM, Kevin Falcone 
> wrote:
>
>> On Wed, Jan 15, 2014 at 12:25:17PM -1000, Mathew Snyder wrote:
>> >Jan 15 17:09:14 zen-rt postfix/qmgr[6294]: 314F2808AD: from=<[26]
>> u...@example.com>, size=447,
>> >nrcpt=1 (queue active)
>> >Jan 15 17:09:15 zen-rt postfix/local[6409]: 314F2808AD: to=<[27]
>> r...@host.example.com>,
>> >relay=local, delay=54, delays=53/0.01/0/0.11, dsn=4.3.0,
>> status=deferred (temporary failure.
>> >Command output: HTTP request failed: 500 No Host option provided.
>> Your webserver logs may have
>> >more information or there may be a network problem. )
>> >Jan 15 17:09:16 zen-rt postfix/smtpd[6375]: disconnect from
>> >[28]host.example.com[192.168.231.42]
>> >I have searched around online and have not seen anything that even
>> references this problem. If
>> >anyone can provide any insight I will be very appreciative.
>>
>> You appear to have asked variants on this question a few times.
>> In each case, a mailing list user asked you for information needed to
>> help you.
>>
>> How are you invoking rt-mailgate, from an aliases file?
>> Show the alias file, with all the options you are passing to
>> rt-mailgate.
>>
>> Have you read your apache error log?  Since you're getting a 500
>> error, and that's an HTPT status code, I'd look there.
>>
>> -kevin
>>
>
>


-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] Postfix error: 500 No Host option provided

2014-01-16 Thread Landon Stewart
I guess that’s why pasting what you actually have instead of what is in the
documentation is important in a problem description.


On 16 January 2014 12:40, Mathew Snyder  wrote:

> Great...
>
> After sending multiple emails due to not seeing responses and then finally
> getting one, I've discovered that the aliases file was malformed. I didn't
> actually have "--url http://host.example.com";. Instead I had "--url http:
> host.example.com"
>
> /facepalm
>
> -Mathew
>
> "When you do things right, people won't be sure you've done anything at
> all." - God; Futurama
>
> "We'll get along much better once you accept that you're wrong and
> neither am I." - Me
>
>
> On Thu, Jan 16, 2014 at 10:37 AM, Landon Stewart wrote:
>
>> From the server itself what if execute the following while in an SSH
>> session (obviously replacing the host.example.com with the correct fqdn
>> of RT):
>>
>> curl http://host.example.com
>>
>> What do you get back?  If you get a 500 error back from that your problem
>> is not RT related (yet).
>>
>>
>> On 16 January 2014 12:30, Mathew Snyder  wrote:
>>
>>> Apologies. I have not been seeing the responses. Checking my spam folder
>>> did not turn up the emails either.
>>>
>>> My aliases file contains two entries. One for rt: and the other for
>>> rt-comment:
>>>
>>> rt:  "|/opt/rt4/bin/rt-mailgate --queue general --action
>>> correspond --url http://host.example.com";
>>> rt-comment:"|/opt/rt4/bin/rt-mailgate --queue general --action
>>> comment --url http://host.example.com";
>>>
>>> The web logs don't mention anything about this.
>>>
>>> -Mathew
>>>
>>> "When you do things right, people won't be sure you've done anything at
>>> all." - God; Futurama
>>>
>>> "We'll get along much better once you accept that you're wrong and
>>> neither am I." - Me
>>>
>>>
>>> On Thu, Jan 16, 2014 at 5:36 AM, Kevin Falcone <
>>> falc...@bestpractical.com> wrote:
>>>
>>>> On Wed, Jan 15, 2014 at 12:25:17PM -1000, Mathew Snyder wrote:
>>>> >Jan 15 17:09:14 zen-rt postfix/qmgr[6294]: 314F2808AD: from=<[26]
>>>> u...@example.com>, size=447,
>>>> >nrcpt=1 (queue active)
>>>> >Jan 15 17:09:15 zen-rt postfix/local[6409]: 314F2808AD: to=<[27]
>>>> r...@host.example.com>,
>>>> >relay=local, delay=54, delays=53/0.01/0/0.11, dsn=4.3.0,
>>>> status=deferred (temporary failure.
>>>> >Command output: HTTP request failed: 500 No Host option provided.
>>>> Your webserver logs may have
>>>> >more information or there may be a network problem. )
>>>> >Jan 15 17:09:16 zen-rt postfix/smtpd[6375]: disconnect from
>>>> >[28]host.example.com[192.168.231.42]
>>>> >I have searched around online and have not seen anything that even
>>>> references this problem. If
>>>> >anyone can provide any insight I will be very appreciative.
>>>>
>>>> You appear to have asked variants on this question a few times.
>>>> In each case, a mailing list user asked you for information needed to
>>>> help you.
>>>>
>>>> How are you invoking rt-mailgate, from an aliases file?
>>>> Show the alias file, with all the options you are passing to
>>>> rt-mailgate.
>>>>
>>>> Have you read your apache error log?  Since you're getting a 500
>>>> error, and that's an HTPT status code, I'd look there.
>>>>
>>>> -kevin
>>>>
>>>
>>>
>>
>>
>> --
>> Landon Stewart :: lstew...@iweb.com
>> Lead Specialist, Abuse and Security Management
>> Spécialiste principal, gestion des abus et sécurité
>> http://iweb.com :: +1 (888) 909-4932
>>
>>
>>
>


-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] Relationship Permissions

2014-01-23 Thread Landon Stewart
On 23 January 2014 11:18, Tim Wiley  wrote:

> rt-4.0.13
>
> We have a Queue A & Queue B.
>
> Ticket A is in Queue A, and Ticket B is in Queue B.
>
> User A has ModifyTicket on Queue A, but not on Queue B.  User A would like
> to make Ticket A refer to Ticket B, but is getting a permission denied
> error.  I can only find documentation requiring ModifyTicket on both queues
> to merge tickets, but not for other relationships.  Is there a way to get
> this to work without granting User A ModifyTicket on Queue B?
>

I don’t think so because when you setup a link of any type on Ticket A RT
will create a reciprocal link on Ticket B pointing to A as referred to by
(in this case).

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] RT crashes during spreadsheet export with "...rt-server.fcgi" aborted: idle timeout (3 sec)

2014-02-03 Thread Landon Stewart
Signal 13 is just a broken pipe, as it says.  You need to find out why it's
broken.  It's probably running out of memory or taking too long.  FastCGI
in my experience likes to timeout and not tell anyone that it did.  I find
it strange that your idle timeout is only 3 seconds.  It'll likely timeout
often while it waits for the database to produce the query results.


On 3 February 2014 09:19, Alex Geo.  wrote:

> Hi all,
>
> Would really appreciate any help/advise on this.
>
> Centos 6.4
> Mysql
> RT 4.0.10
>
> here is what's in /etc/httpd/conf.d/rt.conf :
>
> 
>   ### Optional apache logs for RT
>   # Ensure that your log rotation scripts know about these files
>   # ErrorLog /opt/rt4/var/log/apache2.error
>   # TransferLog /opt/rt4/var/log/apache2.access
>   # LogLevel debug
>
>   AddDefaultCharset UTF-8
>
>   Alias /NoAuth/images/ /opt/rt4/share/html/NoAuth/images/
>   ScriptAlias / /opt/rt4/sbin/rt-server.fcgi/
>
>   DocumentRoot "/opt/rt4/share/html"
> 
>  Order allow,deny
>  Allow from all
>
>  Options +ExecCGI
>  AddHandler fastcgi-script fcgi
> 
> 
>
> I have a queue called TOS with 34 "Ticket Custom Fields", which is
> reproducing a spreadsheet in RT and each ticket is one shipment record. All
> works good!
>
> Now occasionally we need to export some "Saved searches" contents into a
> spreadsheet. When the search contains little amount of results, i.e. 19
> tickets or 36 tickets, the export works as expected. When it contains for
> example 56 tickets - the "Internal Server Error" in the browser.
>
> Looking in the httpd log we have the following:
>
> [Mon Feb 03 16:55:30 2014] [error] [client 10.x.x.x] FastCGI: comm with
> server "/opt/rt4/sbin/rt-server.fcgi" aborted: idle timeout (3 sec),
> referer:
> http://support.company.com/Search/Results.html?Format=%27%3Cb%3E%3Ca%20href%3D%22%2FTicket%2FDisplay.html%3Fid%3D__id__%22%3E__id__%3C%2Fa%3E%3C%2Fb%3E%2FTITLE%3A%23%27%2C%0A%27%3Ca%20href%3D%22%2FTicket%2FUpdate.html%3FAction%3DComment%26amp%3Bid%3D__id__%22%3E__CustomField.%7BShipper%7D__%3C%2Fa%3E%27%2C%0A%27__CustomField.%7BLoadport%7D__%27%2C%0A%27__CustomField.%7BI%7D__%2
> ..
>
> And this above log line is very long listing all of the custom fields.
> Then one second later the following comes into the log:
>
> [Mon Feb 03 16:55:34 2014] [warn] FastCGI: server
> "/opt/rt4/sbin/rt-server.fcgi" (pid 4995) terminated due to uncaught signal
> '13' (Broken pipe)
> [Mon Feb 03 16:55:34 2014] [warn] FastCGI: server
> "/opt/rt4/sbin/rt-server.fcgi" restarted (pid 16011)
>
> Any clues how to overcome this issue? We will need to be exporting into
> spreadsheets on a monthly basis, and the amount of tickets in the queue
> will be growing approx 100 per month.
>
> Thanks in advance for your assistance!
>
> Kind regards,
> Alex Geo.
>



-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


Re: [rt-users] How to grab requestor's first and last name in email address ?

2014-02-05 Thread Landon Stewart
On 5 February 2014 11:16, Ethier, Michael  wrote:

>  Hello,
>
>
>
> I need to obtain the first and last name that would be part of the
> requestor's email address.
>
> For example, requestor email address comes in as:
>
>
>
> From: "Smith, Joe" 
>
>
>
> In this example I want parse out the "Joe" and "Smith" keywords and assign
> them to 2 variables
>
> which I will use for comparison later.
>
>
>
> I am writing a RT Scrip. Is this possible to do ?
>

The "name" of the requestor is stored within the UsersObj in the Requestors
group object for the $Ticket.  You want the first UsersObj.  There's no way
to know if it's the name is written "Last, First" or "First Last" so you'll
have to figure that out somehow.  Usually a comma in a name field means
"Last, First" though so the following is a decent bet.  I haven't tested
this code but this ought to get you close anyway.

my $realname = $self->TicketObj->Requestors->UsersObj->First->RealName;
# Switch things around if there's a comma in the field.
$realname =~ s/(.*),\s*(.*)/$2 $1/ if $realname =~ /,/;

If they have "First Last, Company" it'll come out as "ACME Inc., Jim Smith"
though which might not be terrible.
Worse would be "Last, First - Position" coming out as "Jim - Manager Smith"
which might sound a little too familiar for business.

In my opinion you'd want to just leave it as-is so if it's Last, First and
they get an email addressed to them with "Dear Smith, Jim:" they'll know
it's because they have it that way in their mail client.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932


[rt-users] MySQL Question (joins and stuff)

2014-03-03 Thread Landon Stewart
Hello,

I'd never modify the database without the API but I'd like a flattened
version of the data as a snapshot every so often for statistical purposes.
 If I run the following MySQL query I basically get a line for every
CustomField Value and it duplicates all the T.* fields while writing new
data for the OCFV.* values on each line of course.

SELECT
T.id,Q.Name,T.Subject,T.Status,T.Created,T.Resolved,CF.Name,OCFV.Content
FROM Tickets T, ObjectCustomFieldValues OCFV,CustomFields CF,Queues Q
 WHERE T.id = OCFV.ObjectID AND OCFV.CustomField = CF.id AND T.Queue = Q.id
AND Q.Name = "Incidents"
 AND T.Status != "abandoned"
AND OCFV.Disabled = 0
LIMIT 1000;

OUTPUT:
id Name Subject Status Created Resolved Name Content
16478020 Incidents open resolver - This host is most likely running an open
DNS resolver. open 2013-09-19 19:19:41 2013-10-04 16:25:04 Constituency
EDUNET
16478020 Incidents open resolver - This host is most likely running an open
DNS resolver. open 2013-09-19 19:19:41 2013-10-04 16:25:04 IP 10.0.0.220
16478020 Incidents open resolver - This host is most likely running an open
DNS resolver. open 2013-09-19 19:19:41 2013-10-04 16:25:04 CCName 
16478020 Incidents open resolver - This host is most likely running an open
DNS resolver. open 2013-09-19 19:19:41 2013-10-04 16:25:04 ClientName Johnny
Appleseed
16478020 Incidents open resolver - This host is most likely running an open
DNS resolver. open 2013-09-19 19:19:41 2013-10-04 16:25:04 Customer 9877659
16478020 Incidents open resolver - This host is most likely running an open
DNS resolver. open 2013-09-19 19:19:41 2013-10-04 16:25:04 PreferredLanguage
English

What I'd like to do is have the output with the T.* columns like normal and
each CF.Name as a column name with the value from OCFV.Content would be
desired.  I think I know this involves using the right INNER or OUTER or
FULL JOIN or sub-queries or something but I'm afraid that's over my head
here.  I'm familiar with JOINs but not turning a table on it's side.  It's
either this or have a ridiculous amount of output feed into some ridiculous
kludgy script to reformat it.

If anyone knows how I could flatten this data so a snapshot of each ticket
(within a date range based on Tickets.Created or Tickets.Resolved) on one
line with CF names as columns and CF values as values can be achieved I
would really really appreciate it.  Failing that if anyone knows of any
tips to figure this out (like a primer on turning tables on their side) I'd
appreciate any advice you can give me.  :-D


-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932
-- 
RT Training London, March 19-20 and Dallas May 20-21
http://bestpractical.com/training

Re: [rt-users] MySQL Question (joins and stuff)

2014-03-04 Thread Landon Stewart
Jason this is brilliant!  Thank you!


On 4 March 2014 13:57, j.hubbard  wrote:

> Hi Landon, below is some sql I wrote (I'm not too good at sql so some of it
> could probably be optimized).  It pulls a bunch of fields both system and
> custom as well as the first comment on the ticket and names the columns
> something friendly.  Also it compensates for timezones since the db is in
> UTC.
>
> Hopefully it helps.
>
> The custom fields I am pulling are "Priority" (not the built-in one) and
> "Category".  I have two different "Category" custom fields from two
> different queues but I am showing them both in one column, hence the OR in
> the first custom field join statement below.
>
> Let me know
>
>
>
> --begin SQL--
>
> SELECT T.id, T.EffectiveId, DATE(CONVERT_TZ(T.Created, '+00:00', '-04:00'))
> as 'Day Created',
> CONVERT_TZ(T.Created, '+00:00', '-04:00') as Created,
> CONVERT_TZ(T.Resolved,
> '+00:00', '-04:00') as Resolved,
> WEEK(CONVERT_TZ(T.Created, '+00:00', '-04:00')) as week,
> MONTH(CONVERT_TZ(T.Created, '+00:00', '-04:00')) as Month,
> U3.Name as 'Requestor', U6.EmailAddress as 'Requestor Email', U5.RealName
> as
> 'Requestor RealName',
> U4.City as 'Requestor City', U.name as 'Owner', U2.RealName as 'Owner
> RealName', Q.id as QueueID,
> Q.Name as 'Queue Name', T.Status, OOCF.Content as 'Priority',
> OCF.Content as 'Category', OCF.ObjectId, OCF.CustomField, T.Subject,
> TO_DAYS(IF(Resolved != '-00-00 00:00:00' AND
> Resolved != '1970-01-01 00:00:00',
> DATE(Resolved), CURDATE())) -
> TO_DAYS(DATE(T.Created)) as days_open
> FROM Tickets T
> LEFT JOIN Users U on U.id = T.Owner
> LEFT JOIN Users U2 on U2.id = T.Owner
> LEFT JOIN Queues Q on Q.id = T.Queue
> LEFT JOIN Users U3 on U3.id = T.Creator
> LEFT JOIN Users U4 on U4.id = T.Creator
> LEFT JOIN Users U5 on U5.id = T.Creator
> LEFT JOIN Users U6 on U6.id = T.Creator
> LEFT JOIN (ObjectCustomFieldValues OCF) on (OCF.ObjectId = T.id AND
> (OCF.CustomField = '3' OR OCF.CustomField = '5'))
> LEFT JOIN (ObjectCustomFieldValues OOCF) on (OOCF.ObjectId = T.id AND
> OOCF.CustomField = '4')
> WHERE Type = 'ticket'
> AND
> (
> Status IN ('open','stalled','new','autoclose','resolved','rejected')
> OR
> (
> Status = 'resolved'
> AND Resolved > DATE_SUB(CURDATE(), INTERVAL 30 DAY)
> )
> )
> ORDER BY T.id
>
> --end SQL--
>
>
>
> --
> View this message in context:
> http://requesttracker.8502.n7.nabble.com/MySQL-Question-joins-and-stuff-tp56822p56850.html
> Sent from the Request Tracker - User mailing list archive at Nabble.com.
> --
> RT Training London, March 19-20 and Dallas May 20-21
> http://bestpractical.com/training
>
>


-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932
-- 
RT Training London, March 19-20 and Dallas May 20-21
http://bestpractical.com/training

[rt-users] How can I take a user's dashboard and making it the default for everyone

2014-03-26 Thread Landon Stewart
Hello,

A staff member is creating a dashboard which we'd like to use as the
default for all other staff members.  I'd like to do this with the UI of
course since making changes to the actual database is never a good idea but
in an attempt to get familiar with how this might work under the hood,
after a cursory eyeballing, I can't even seem to find the saved searches in
the MySQL tables let alone the dashboard configuration.  I assume they are
some kind of Object but I don't know what to look for.

How can one either copy their dashboard to be the default for a group or
somehow allow them to create the default dashboard for the group by
temporarily elevating their privileges or something?

Unfortunately, like many I suppose, I've never become super familiar with
how the dashboards work. I've always just used the defaults and dabbled a
little but nothing serious.

Thanks for reading and any information you can offer.

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932
-- 
RT Training - Dallas May 20-21
http://bestpractical.com/training

[rt-users] Sorting by the value of a custom field in search results *numerically*

2014-05-02 Thread Landon Stewart
Hello,

It seems that the sorting by custom field in search results is always done
alphabetically.

For example sorting by CF that contains only integers in descending order:
4
3
2
11
1

Is there a way to sort search results by custom field numerically?

-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932
-- 
RT Training - Dallas May 20-21
http://bestpractical.com/training

Re: [rt-users] Sorting by the value of a custom field in search results *numerically*

2014-05-06 Thread Landon Stewart
Thanks for your replies guys.  And thanks for adding that feature request
Brent (http://issues.bestpractical.com/Ticket/Display.html?id=29638).


On 2 May 2014 13:52, Landon Stewart  wrote:

> Hello,
>
> It seems that the sorting by custom field in search results is always done
> alphabetically.
>
> For example sorting by CF that contains only integers in descending order:
> 4
> 3
> 2
> 11
> 1
>
> Is there a way to sort search results by custom field numerically?
>
> --
> Landon Stewart :: lstew...@iweb.com
> Lead Specialist, Abuse and Security Management
> Spécialiste principal, gestion des abus et sécurité
> http://iweb.com :: +1 (888) 909-4932
>
>
>


-- 
Landon Stewart :: lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932
-- 
RT Training - Dallas May 20-21
http://bestpractical.com/training

Re: [rt-users] how to allow subject line if update is from specific email address

2014-11-13 Thread Landon Stewart
On Nov 13, 2014, at 5:06 AM, Atif Mehboob  wrote:
> 
> Hi All,
>  
> We are using RT 4.2.1. How can we allow a specific email address to update 
> the subject line of ticket in any queue.  Any suggestions please?
>  
> Regards,
> Atif

Hi Atif,

We do this using a scrip (in this case it'd be a global scrip).  Update it with 
the email address in question.

Description:
Update the subject for theem...@address.com

Condition:
On Correspond

Action: (User defined)
my $attachments = $self->TransactionObj->Attachments;
$attachments->Columns( qw(id Headers Subject) );
my $attachment = $attachments->First;
return 0 unless $attachment;
return 0 unless $self->TicketObj->IsWatcher( Type => 'Requestor', Email => 
'theem...@address.com ' );
my $subject = $attachment->GetHeader('Subject');
return 0 unless $subject;
$self->TicketObj->SetSubject($subject);
return 1;

Template:
Global template: Blank

Stage: 
TransactionCreate

Re: [rt-users] Problem with date

2014-11-19 Thread Landon Stewart
On Nov 19, 2014, at 11:18 AM, Bryon Baker  wrote:
> The dates printed to the console are correct but when I view the ticket the 
> resolved date is different than the dates printed to the console by 6 hours.  
> This seems to me to be the off set for the time zone.  What do I need to add 
> for Request Tracker to take the date as is?

Hi Byron,

AFAIK RT provides it's own offset when printing dates/times in the UI so one 
must store the date/time as UTC.  What is printed on the console should 
actually be UTC.  Date/Time entered by users or stored in any way need to be 
converted to UTC first.

More info:
http://bestpractical.com/docs/rt/latest/RT_Config.html#Date-and-time-handling 
<http://bestpractical.com/docs/rt/latest/RT_Config.html#Date-and-time-handling>

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Warning before sending correspondence

2014-12-20 Thread Landon Stewart
On Dec 20, 2014, at 7:31 AM, Jason Foster  wrote:
> 
> We just got ... singed ... when someone accidentally sent a comment as 
> correspondence.  Even with the red background in the message box.
> 
> I'm guessing that this is a common failure mode, and am wondering whether 
> there is a { setting, plugin } that will pop up a "This is going to the 
> Requestor ... are you sure?" alert before sending?

There's definitely no setting and I don't think I've seen a plugin for this.  
Although this sounds like one of those cases where a technological solution to 
a problem with people might not be the answer perhaps modifying the textbox 
with some default text (ie. "This response will be seen by customers - remove 
this text.") for correspondence with something they have to actually remove 
before typing might be a relatively simple way to achieve some warning.

--
Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Scrip for adding to the custom field based on another CF

2015-01-21 Thread Landon Stewart
On Jan 21, 2015, at 7:07 AM, Kevin Squire  wrote:
> 
> 
> I have a scrip currently that checks for status change from X--> Y and if 
> true, adds an entry to the Custom Field "RMA Num".  It adds our RMA number, 
> which is really just "RMA-$RT_Ticket_Number"
> 
> They have asked me to change the number based on another CF "RMA TYPE".  If 
> the RMA type = "Student Withdrawl" they want the RMA number to be appended 
> with "WD"
> 
> 
> My perl skills are limited to copy/paste and tweaking existing so I would 
> like a little bit of help with my If/Then statement.  The idea being:
> 
> IF CustomField{RMA Type} = Student Withdrawl
> THEN $Append = "-WD"
> ELSE $Append = ""
> 
> Then in the current line (below)
>  my $Value = "RMA-" . $Num ;
> 
> would be changed to
>   my $Value = "RMA-" . $Num . $Append ;

This can be done with one ternary operator:
my $value = $self->TicketObj->FirstCustomFieldValue('RMA Type') eq 'Student 
Withdrawl' ? "RMA-" . $Num : "RMA-" . $Num . $Append;

Some notes:
- The condition here is:  $self->TicketObj->FirstCustomFieldValue('RMA Type') 
eq 'Student Withdrawl'
- If the condition is true then $value will equal what's between the ? and the 
: (colon)
- If the condition is false then $value will equal what's between the : and the 
; (semi-colon)

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Cancel "Resolve" transaction based on custom fields

2015-01-29 Thread Landon Stewart
On Jan 28, 2015, at 5:27 AM, Jasper Olbrich 
 wrote:
> 
> Hello,
> 
> I want to cancel or undo the "Mark as Resolved" transaction based on the 
> content of custom fields. Currently I'm using a Scrip and I'm only able to do 
> the following:
> 
> * access the custom fields
> * make the decision
> * comment on the ticket with the reason why it can't be resolved
> * reopen the ticket
> 
> From the ticket's history, I can tell that it is resolved first, then my 
> scrip adds the comment and reopens it. But yellow "Results" box shows only 
> "Status changed from open to resolved".
> 
> Is it possible to suppress the status change from open to resolved with a 
> scrip or to include the scrip-induced status change in the result box?

I hope I'm understanding this correctly...

I would use a Scrip with a condition of "On Resolve" and have the scrip 
evaluate the ticket to see if it should be reopened.  If it should be reopened 
the action portion of the scrip would open the ticket via 
$self->TicketObj->Status("open") again.

Name of Scrip:
"On Resolve Reopen if CustomFieldName Contains Some Text"

Condition: Select "On Resolve"

In the preparation section of the Scrip:
return 0 unless $self->TicketObj->FirstCustomFieldValue("CustomFieldName") =~ 
/Some Text/;
return 1;

In the action (commit) section of the Scrip:
$self->TicketObj->Status("open");
$self->TicketObj->Comment( Content => "Script re-opened because CustomFieldName 
is ".$self->TicketObj->FirstCustomFieldValue("CustomFieldName") );

Maybe?

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Cancel "Resolve" transaction based on custom fields

2015-01-29 Thread Landon Stewart
On Jan 29, 2015, at 3:05 PM, Landon Stewart  wrote:
> In the action (commit) section of the Scrip:
> $self->TicketObj->Status("open");
> $self->TicketObj->Comment( Content => "Script re-opened because 
> CustomFieldName is 
> ".$self->TicketObj->FirstCustomFieldValue("CustomFieldName") );

Oops.  Should read "Ticket re-opened because..."

And it should be followed by:

return 1;


Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


[rt-users] The use of $Ticket{'TOP'}->CustomFieldValues($fieldname) with RT::Action::CreateTickets

2015-03-10 Thread Landon Stewart
Hello,

It seems that one cannot load the values of a CF with 
$Ticket{'TOP'}->CustomFieldValues($fieldname).  The result is an empty 
variable.  I've confirmed that the foreach works for each of the $cfname in the 
@cflist since I get log entries for them but $cfvs->Next doesn't produce a 
value (nothing is logged).

===Create-Ticket: Investigation
{
  my @cflist = [ 'Customfield1', 'Customfield2', 'etc'];
  our @CFTEXT;
  foreach my $cfname (@cflist) {
RT::Logger->info($cfname);
my $cfvs = $Tickets{"TOP"}->CustomFieldValues($cfname);
while (my $cfv = $cfvs->Next) {
  RT::Logger->info($cfname.": ".$cfv->Content);
  push @CFTEXT, "CF-".$cfname.": ".$cfv->Content;
}
  }
}
Queue: Investigations
Parents: TOP
Status: open
{ join("\n", @CFTEXT) }
Content-Type: text/html
Content:{$Tickets{"TOP"}->Transactions->First->Content}
ENDOFCONTENT

LOGS from the foreach() (but not from the while()):
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer ID (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Language (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Name (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Email (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Email Tech (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Status (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Service Type (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Service Status (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Name (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Status (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device O/S (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Control Panel (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer DBID (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Country (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Created (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Closed (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Groups (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Ticket Priority (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer Managed (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Customer SystemDB (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Service DBID (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Service Price (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Service Created (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Service Closed (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device DBID (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Created (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Closed (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Type (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Facility (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Bits (template:8)
[16779] [Tue Mar 10 06:52:53 2015] [info]: Device Addresses (template:8)



I've also tried loading the CF using 
$Tickets{"TOP"}->LoadCustomFieldByIdentifier($cfname) but this does not work 
either.

Basically I'm waning to copy a list of CFs from $Tickets{'TOP'} to the newly 
created one.

Thank you.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] The use of $Ticket{'TOP'}->CustomFieldValues($fieldname) with RT::Action::CreateTickets

2015-03-10 Thread Landon Stewart
On Mar 10, 2015, at 2:29 AM, Alex Peters  wrote:
> 
> You need to output "CustomField-$cfname" as the key, not "CF-$cfname".
> 
> 

CF-$cfname should work as well but more importantly nothing is being outputted 
there which is the problem I'm most concerned with.


Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] The use of $Ticket{'TOP'}->CustomFieldValues($fieldname) with RT::Action::CreateTickets

2015-03-10 Thread Landon Stewart
Hello RT-Users,

Nevermind!  :-)

I'm doing a chain of RT::Action::CreateTickets and it turns out my problem was 
that the custom fields were not being set before the Investigation ticket 
creation and therefor the CF's had no values.  Once the issue with that was 
resolved it all started working perfectly.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932


> On Mar 10, 2015, at 12:15 AM, Landon Stewart  wrote:
> 
> Hello,
> 
> It seems that one cannot load the values of a CF with 
> $Ticket{'TOP'}->CustomFieldValues($fieldname).  The result is an empty 
> variable.  I've confirmed that the foreach works for each of the $cfname in 
> the @cflist since I get log entries for them but $cfvs->Next doesn't produce 
> a value (nothing is logged).
> 
> ===Create-Ticket: Investigation
> {
>   my @cflist = [ 'Customfield1', 'Customfield2', 'etc'];
>   our @CFTEXT;
>   foreach my $cfname (@cflist) {
> RT::Logger->info($cfname);
> my $cfvs = $Tickets{"TOP"}->CustomFieldValues($cfname);
> while (my $cfv = $cfvs->Next) {
>   RT::Logger->info($cfname.": ".$cfv->Content);
>   push @CFTEXT, "CF-".$cfname.": ".$cfv->Content;
> }
>   }
> }
> Queue: Investigations
> Parents: TOP
> Status: open
> { join("\n", @CFTEXT) }
> Content-Type: text/html
> Content:{$Tickets{"TOP"}->Transactions->First->Content}
> ENDOFCONTENT




signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] The use of $Ticket{'TOP'}->CustomFieldValues($fieldname) with RT::Action::CreateTickets

2015-03-12 Thread Landon Stewart
On Mar 10, 2015, at 3:28 AM, Christian Loos  wrote:
> 
> @Alex:
> CreateTickets support both, CustomField and CF keys [1].
> 
> @Landon:
> Why don't you simply add this lines to you template, as you are using a
> static customfield list and don't want to add all customfields (assuming
> you customfields are single value fields):
> 
> CF-Customfield1: {$Tickets{'TOP'}->FirstCustomFieldValue('Customfield1')}
> CF-Customfield2: {$Tickets{'TOP'}->FirstCustomFieldValue('Customfield2')}
> CF-etc: {$Ticket{'TOP'}->FirstCustomFieldValue('etc')}

The problem with using FirstCustomFieldValue() is that I'd, of course, only get 
the first value for each CF but I want all the values for each CF to be copied 
over.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] TicketSQL to select all tickets with requestor "nobody in particular"

2015-03-13 Thread Landon Stewart
Our "Nobody" user is ID #6 so I'd use that in the TicketSQL query as:

"Requestor.id = 6"

You can find out what your "Nobody" user's ID is (probably the same as ours):

1) Admin -> Users -> Select
2) Go to user: Nobody
3) click "Go!"

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932

> On Mar 13, 2015, at 1:02 PM, Al Joslin  wrote:
> 
> What is the TicketSQL to select all tickets with requestor "nobody in 
> particular” ?
> 
> I can’t get  that list from the Search GUI either
> 
> thanks
> al;



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] How to email entire ticket history and attach items from tickets

2015-03-13 Thread Landon Stewart
Hi Rick,

For the complete history of a ticket you need to first load the tickets 
transactions and then select those you want to cycle through - then cycle 
through them and only printing the create and correspond content.

In the template try something like this code block:
{
# Select which transactions to cycle through
my $transactions = $Ticket->Transactions;
$transactions->Limit( FIELD => 'Type', VALUE => 'Create' );
$transactions->Limit( FIELD => 'Type', VALUE => 'Correspond', 
ENTRYAGGREGATOR => 'OR', OPERATOR => '=' );

# Build the $content variable up - we'll be concatenating to this string 
below
my $content;
while (my $transaction = $transactions->Next) {
my $attachments = $transaction->Attachments;
while (my $attachment = $attachments->Next) {
next unless $attachment->ContentType =~ 
m!^(text/html|text/plain|message|text$)!i;  # skip non-text stuff
# Only include headers if they are present on the attachment
$content .= defined $attachment->GetHeader('From') ? "From: 
".$attachment->GetHeader('From')."\n" : "";
$content .= defined $attachment->GetHeader('To') ? "To: 
".$attachment->GetHeader('To')."\n" : "";
$content .= defined $attachment->GetHeader('Subject') ? "Subject: 
".$attachment->GetHeader('Subject')."\n\n" : "";
# Include the content of the attachment
$content .= defined $attachment->OriginalContent ? 
$attachment->OriginalContent : "";
}
}
return $content;
}

The above is not really tested code but I know the idea behind it works.

You've got me on the attachments.  I'd like to know more about that as well 
since attaching a file from a past update to a new a ticket update would be 
awesome.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932

> On Mar 13, 2015, at 1:58 PM, Rick Zoerner  wrote:
> 
> Hi,
> 
> I have set up an approval process for invoices that is working perfectly up 
> to the paying part. However, to finish it up I have 2 tasks I can't figure 
> out on my own.
> 1)   I need to be able to send the entire "History" of the ticket in an 
> email, and,
> 2)   Attach any and all attachments from a particular custom field (of a 
> type=attach multiple documents).
> 
> So far, for this project, I have:
>   1- created a custom lifecycle using status changes to move a CapEx through 
> stages of authorization, acquisition, approval for payment and payment.
>   2- created custom templates for each status. Each status change triggers an 
> email using a template customized  for that person/stage in the process (i.e. 
> "Manager Approval", "IT Approval", "Finance Approval", "Acquire", 
> "ApproveToPay", "Coding", "Pay").
>   3- set up custom fields in the ticket to hold all the attachments needed 
> during the process in a consistent location. Quotes, invoices, etc.
> 
> The history display is particularly important because it is the audit trail 
> of all the approvals. Each approval level is just a drop-down custom field in 
> the ticket (approved/denied). It is the history that shows who flipped it to 
> "Approved" and the date/time stamp of when they did.
> 
> It works great for everybody in the sequence except the final stage - paying 
> the invoice(s).
> Finance has to open the ticket, print the web page to capture the history 
> (audit trail), then find the attachments and open/print each of them, then 
> look at the field where coding listed how to book the payable (GL account and 
> dollar amount), etc.
> 
> Since I am already sending them an email with a link to the ticket in it when 
> the status changes to "pay"... I would like to include in that email the full 
> history, a couple other custom fields I can capture easily (like the coding, 
> the original justification, etc.), and attach the invoices - one-stop 
> shopping for A/P. I just can't find anything to help me figure out how to 
> call out the entire ticket history.
> 
> Thanks in advance to anyone who has a ready answer for this - I'm NOT a 
> programmer at all, so I've spent several days looking through the 
> documentation and only barely able to understand a fraction of it. Please 
> speak to me as to a child - in Perl that would be an overly generous 
> appraisal of my ability.
> 
> -Rick
> 



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] How to email entire ticket history and attach items from tickets

2015-03-13 Thread Landon Stewart
Hi Rick,

I should mention you'll want to make sure that stuff is sorted in chronological 
order before you cycle through the transactions too.  You don't want them to be 
out of order or people will get confused.

Put these two lines before the while() loop:

$Transactions->OrderBy; # Default sort order
$Transactions->GotoFirstItem;

Also while searching for the OrderBy function I came across this which might 
help you even more:

http://requesttracker.wikia.com/wiki/AddTicketHistoryToMail

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932

> On Mar 13, 2015, at 4:05 PM, Landon Stewart  wrote:
> 
> Hi Rick,
> 
> For the complete history of a ticket you need to first load the tickets 
> transactions and then select those you want to cycle through - then cycle 
> through them and only printing the create and correspond content.
> 
> In the template try something like this code block:
> {
> # Select which transactions to cycle through
> my $transactions = $Ticket->Transactions;
> $transactions->Limit( FIELD => 'Type', VALUE => 'Create' );
> $transactions->Limit( FIELD => 'Type', VALUE => 'Correspond', 
> ENTRYAGGREGATOR => 'OR', OPERATOR => '=' );
> 
> # Build the $content variable up - we'll be concatenating to this string 
> below
> my $content;
> while (my $transaction = $transactions->Next) {
> my $attachments = $transaction->Attachments;
> while (my $attachment = $attachments->Next) {
> next unless $attachment->ContentType =~ 
> m!^(text/html|text/plain|message|text$)!i;  # skip non-text stuff
> # Only include headers if they are present on the attachment
> $content .= defined $attachment->GetHeader('From') ? "From: 
> ".$attachment->GetHeader('From')."\n" : "";
> $content .= defined $attachment->GetHeader('To') ? "To: 
> ".$attachment->GetHeader('To')."\n" : "";
> $content .= defined $attachment->GetHeader('Subject') ? "Subject: 
> ".$attachment->GetHeader('Subject')."\n\n" : "";
> # Include the content of the attachment
> $content .= defined $attachment->OriginalContent ? 
> $attachment->OriginalContent : "";
> }
> }
> return $content;
> }
> 
> The above is not really tested code but I know the idea behind it works.
> 
> You've got me on the attachments.  I'd like to know more about that as well 
> since attaching a file from a past update to a new a ticket update would be 
> awesome.
> 
> Landon Stewart : lstew...@iweb.com <mailto:lstew...@iweb.com>
> Lead Specialist, Abuse and Security Management
> Spécialiste principal, gestion des abus et sécurité
> http://iweb.com <http://iweb.com/> : +1 (888) 909-4932
> 
>> On Mar 13, 2015, at 1:58 PM, Rick Zoerner > <mailto:rick.zoer...@cccparts.com>> wrote:
>> 
>> Hi,
>> 
>> I have set up an approval process for invoices that is working perfectly up 
>> to the paying part. However, to finish it up I have 2 tasks I can't figure 
>> out on my own.
>> 1)   I need to be able to send the entire "History" of the ticket in an 
>> email, and,
>> 2)   Attach any and all attachments from a particular custom field (of a 
>> type=attach multiple documents).
>> 
>> So far, for this project, I have:
>>   1- created a custom lifecycle using status changes to move a CapEx through 
>> stages of authorization, acquisition, approval for payment and payment.
>>   2- created custom templates for each status. Each status change triggers 
>> an email using a template customized  for that person/stage in the process 
>> (i.e. "Manager Approval", "IT Approval", "Finance Approval", "Acquire", 
>> "ApproveToPay", "Coding", "Pay").
>>   3- set up custom fields in the ticket to hold all the attachments needed 
>> during the process in a consistent location. Quotes, invoices, etc.
>> 
>> The history display is particularly important because it is the audit trail 
>> of all the approvals. Each approval level is just a drop-down custom field 
>> in the ticket (approved/denied). It is the history that shows who flipped it 
>> to "Approved" and the date/time stamp of when they did.
>> 
>> I

Re: [rt-users] Search Query Builder Issues (Space Encoding?)

2015-03-19 Thread Landon Stewart
On Mar 19, 2015, at 8:20 AM, Richard Stevens  wrote:
> ...
> The end result is:
> 
> [25773] [Thu Mar 19 14:56:10 2015] [error]: Wrong query, expecting a OPERATOR 
> in 'Queue = 'Incident Reports' AND CF.{Affected >Users}<--here LIKE 'frog'' 
> at /opt/rt4/sbin/../lib/RT/SQL.pm line 130.
> 
> Has anyone observed this type of behaviour?

Hi Richard,

I had this problem just the other day actually.  You must enclose CF.{...} in 
single quotes when ... has a space in it.

Instead of:  CF.{Affected Users}
Do this: 'CF.{Affected Users}'

Also to see what you are looking at in plain text you can visit the full URL 
and then change RTIR/Search/Results.html to /Search/Build.html and then click 
"Advanced" on the top right.  The "Query" box will give you the plain text of 
the search you are performing for any given URL.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] change queue not triggering Scrip

2015-03-20 Thread Landon Stewart
On Mar 20, 2015, at 5:20 AM, a.sm...@ldex.co.uk wrote:
> 
> Hi,
> 
>   I've created a Scrip with condition "On Queue Change" but it only works 
> when I change the queue via the GUI. I've created a little custom perl module 
> in Actions to change the queue which works great (I'm calling it from 
> rt-crontool), but it doesn't trigger the Scrip. Anyone any ideas what's going 
> on?
> 
> 
I've noticed that some of the things done with rt-crontool don't get recorded 
and therefor don't trigger scrips.  This might be because of something minor 
missing in your custom perl module (custom action).  When the custom perl 
module changes the queue do you see a transaction listed in the ticket history 
reflecting the queue change or is the queue just different on the ticket with 
no mention of it in the ticket history?  If there's no mention of it in the 
ticket history it means that the transaction is not recorded.  This is similar, 
although not quite the same as, AddCustomFieldValue( Field ..., Value ..., 
RecordTransaction => 0 ).  I'd probably try and find a way to get the queue 
change to be recorded in the ticket history that way it would trigger scrips 
such as the "On Queue Change" one you have that works when using the GUI.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932




signature.asc
Description: Message signed with OpenPGP using GPGMail


[rt-users] Is there a way to include attachments from $Tickets{"TOP"} when using RT::Action::CreateTickets ?

2015-03-24 Thread Landon Stewart
Hello,

I'm using RT::Action::CreateTickets to create a ticket with the contents of a 
template.  In the template I'm using 
"{$Tickets{"TOP"}->Transactions->First->Content}" in the 'Content:' of the 
ticket which is working.

Is there a way to include all attachments that might be present on that 
transaction as well?  I've found the example code for including ticket history 
in another ticket but it doesn't really apply because I'm creating the ticket 
with a template using RT::Action::CreateTickets.

I suppose if there's no way I'll have to abandon the use of 
RT::Action::CreateTickets and write a custom action module more similar to the 
example code I found.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Custom Fields

2015-03-24 Thread Landon Stewart
On Mar 24, 2015, at 11:49 AM, Bryon Baker  wrote:
> 
> Hello all
> Can custom fields be used in graphs?  If so can someone point me in the 
> direction of some article explaining how?

Yes.  Before version 4.2 you perform a search and make sure to select the 
"Queue" as part of the query so the queue specific CFs are loaded.  Once that 
is done you click "Chart" on the upper right.  You can then use the dropdown 
for "Show chart grouped by" to select any field including custom fields.

In 4.2 however you can graph by multiple custom fields at once.

Example:


Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Custom Fields

2015-03-24 Thread Landon Stewart
On Mar 24, 2015, at 2:10 PM, Bryon Baker  wrote:
> 
> Sorry I did not explain this very well.
> 
> The area I would like to use the custom field in is the Calculate section of 
> the graphing tool.
> 
> Also I am using version 4.2.3

A!  Well ya got me there.  I don't know.  I checked mine (4.2.9) and it's 
not available, only date fields that you are probably already seeing listed as 
well.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] need to run code when user presses a button

2015-03-26 Thread Landon Stewart
On Mar 26, 2015, at 11:52 AM, Al Joslin  wrote:
> 
> I would like to have a button on the display page of a ticket that when 
> clicked runs some code (*) which then causes the display page to refresh
> 
> I have the code (*) written which queries a remote database and updates an rt 
> ticket based on what it finds
>   - this is all perl code, using DBI to connect the external db
> 
> I don’t care if the code is stored in RT or not
> 
> How can I do this?
> 
> I can create a button on the Ticket display page which submits a form to an 
> url, perhaps I should return the result as a redirect back to the Ticket 
> display page ?

Hi Al,

There is probably a way to hack this into the RT pages but the way I'd probably 
do it is build a separate webpage on a different virtualhost that will do what 
you want (very simple page with the button) and the necessary headers to 
redirect to the referrer.  Then I'd use a custom field to show that page 
(custom fields can show data *or* actual webpage content).  When I click the 
button within the custom field that's displaying this other page it would go to 
that page, do what it's supposed to do and then redirect back to the referrer 
(the display page in RT).  Be sure to protect the page on the virtualhost 
somehow so it's not available to someone who should not see/use it.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] web request from custom scrip

2015-04-02 Thread Landon Stewart
> 
> On Apr 2, 2015, at 11:03 AM, Hugo Escobar  wrote:
> 
> Hi,
> 
> I'm trying to write a scrip that sends a web request to an external server
> and depending on the answer set a specific priority level
> 
> So far the web request goes out and the priority can be set. The only
> missing part is that I can't get a hold of the external web server response.
> 

Hi Hugo,

Firstly - Does https://extwebserv/ have a real certificate?

Try the following instead.  I haven't tested it but basically it tries the URL 
and sets the priority if it was successful.  It also logs the response message 
(a short human readable single line string that explains the response code) 
regardless of what it was.  It returns whatever $status is (if it's set then 
it'll be non-zero).

use LWP::UserAgent;

my $url = 'https://extwebserv/'.somePieceOfData;
RT::Logger->info("Ticket ".$self->TicketObj->id." Checking ".$url);
my $ua = LWP::UserAgent->new;
my $response = $ua->get($url);
my ($status, $msg);  # Set these up as empty for now
($status, $msg) =  $self->TicketObj->SetPriority('100') if 
$response->is_success;
RT::Logger->info("Ticket ".$self->TicketObj->id." ".$response->message);
return $status;


Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] RT::Extension::Announce post install question

2015-04-08 Thread Landon Stewart
On Apr 8, 2015, at 8:36 AM, Karres, Dean  wrote:
> 
> Hi,
> 
> I am running RT 4.2.10.  I just used cpan to install RT::Extension::Announce 
> and I looked at the resulting install messages.  I see the line where is says 
> to run “make initdb” but can’t tell if the CPAN make did that or if I still 
> need to.  I see in the docs that running the initdb step more than once can 
> be a bad thing.  How can I tell if initdb has already been run?

I would check the Makefile to see what initdb actually does and then check the 
database to see if it was done.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932




signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] RT::Extension::Announce post install question

2015-04-08 Thread Landon Stewart
I could be wrong but it looks like it adds a queue called "RTAnnounce" and then 
a Custom Field for that queue called 'Announcement Groups'.

Does this mysql query return an record from the Queues table?

SELECT * FROM Queues WHERE Name = 'RTAnnounce';

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932

> On Apr 8, 2015, at 11:48 AM, Karres, Dean  wrote:
> 
> Good idea!.  I did that, the Makefile lines are interesting but obscure.  
> After running the initdb I saw no obvious changes to the DB structure.  I 
> suspect that I’d have to know exactly what changes it was likely to make… 
> again obscure
> 
> 
> 
> From: Landon Stewart [mailto:lstew...@iweb.com]
> Sent: Wednesday, April 08, 2015 1:20 PM
> To: Karres, Dean
> Cc: rt-users@lists.bestpractical.com
> Subject: Re: [rt-users] RT::Extension::Announce post install question
> 
> On Apr 8, 2015, at 8:36 AM, Karres, Dean  <mailto:kar...@illinois.edu>> wrote:
> 
> Hi,
> 
> I am running RT 4.2.10.  I just used cpan to install RT::Extension::Announce 
> and I looked at the resulting install messages.  I see the line where is says 
> to run “make initdb” but can’t tell if the CPAN make did that or if I still 
> need to.  I see in the docs that running the initdb step more than once can 
> be a bad thing.  How can I tell if initdb has already been run?
> 
> I would check the Makefile to see what initdb actually does and then check 
> the database to see if it was done.
> 
> Landon Stewart : lstew...@iweb.com <mailto:lstew...@iweb.com>
> Lead Specialist, Abuse and Security Management
> Spécialiste principal, gestion des abus et sécurité
> http://iweb.com <http://iweb.com/> : +1 (888) 909-4932
> 
> 



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] User Authentication

2015-04-16 Thread Landon Stewart
On Apr 16, 2015, at 1:28 PM, Jeremy Wilson  wrote:
> 
> Hello,
> I am running RT 4.2.9 on centos release 6.6 (final).  I have tried many, many 
> times to get RT::Authen::ExternalAuth to work and I am unsuccessful.  Active 
> directory 2008 R2.  I have looked at almost every web page I can find on the 
> subject, and have tried multiple configurations.  I have made it to the point 
> of giving up on the extension, and just having a separate username and 
> password.  I want all users except myself and one other to be unprivileged, 
> which I have already setup permissions for unprivileged users to create and 
> comment on their tickets.  I was disappointed to learn that RT does not have 
> a self-registration page, or a bulk input for users.
> 
> What I would like to do is, create CVS file with username and password, then 
> import into mysql database.  Can anyone point me in the direction of know 
> what tables and fields need to be populated to create a user in mysql that 
> the user will use to log into web interface of RT?
> 
> We will not be utilizing the mail function and it is not an option.

Why not just create users using the bin/rt utility?

Example:
/opt/rt4/bin/rt create -t users add Name=userName 
EmailAddress=em...@address.com Password=password

More information can be found here:
http://requesttracker.wikia.com/wiki/CLI 
<http://requesttracker.wikia.com/wiki/CLI>

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] User Authentication

2015-04-16 Thread Landon Stewart
On Apr 16, 2015, at 3:05 PM, Jeremy Wilson  wrote:
> 
> Yep, completely missed that.  Looks like I could use the command tool to 
> accomplish what I need.   Thank you.
> 

You're welcome.  I should mention that at one place I worked at there was no 
way to let RT authenticate against an LDAP servce so instead I used perl to 
grab user data from the LDAP service to generate a "diff".  The perl script 
used the bin/rt utility to add or remove users depending on what the diff said. 
 If there were no new or deleted users in the diff output then there was 
nothing to do.  Just an idea that might help...

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932




signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Cannot Login to RT

2015-04-17 Thread Landon Stewart
Hi Lorraine,

Before anyone can provide any useful answer to this I think we'd need more 
details from you.  Where did you look for the log files before giving up on 
finding them?  Did you check the RT_SiteConfig.pm file to see where logging is 
supposed to be going and then check there?  Did you check in /var/log/* or?  
Usually the log for RT can be found in /opt/rt4/var/log/rt.log but your 
installation might be different.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932

> On Apr 17, 2015, at 6:36 AM, Lorraine Johnson  wrote:
> 
> Hello,
> 
> I try logging into my RT and I get this error
> 
>  " An internal RT error has occurred. Your administrator can find more 
> details in RT's log files."
> 
> I seem not to find the RT log files. Please help



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Is setting up RT to create tickets via Gmail possible?

2015-05-15 Thread Landon Stewart
On May 15, 2015, at 1:52 PM, hydn  wrote:
> ... However, when a reply is posted via email, how can the reply email be 
> retrieved and posted back to RT?

The email should be "From" an email address that pipes directly to rt-mailgate. 
 However you do that is up to you but that's generally how it's done.  If you 
want to use an external POP3 account you can use fetchmail or getmail to 
download the mail and pipe each message to rt-mailgate but all mail to the From 
address needs to pipe to rt-mailgate somehow so that all replies are fed to RT.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Slow ticket search screen draw with RT 4.2.10 and PostgreSQL-9.4

2015-05-20 Thread Landon Stewart
Do you have a ton of users or some other CF with a lot of possible values that 
are only available (list in drop-down or an autocomplete field) to the RT super 
user?

> On May 20, 2015, at 3:13 PM, "k...@rice.edu"  wrote:
> 
> Hi RT community,
> 
> I am testing the performance. When I pull up
> 
> Search->Tickets->New Search
> 
> as the RT superuser, it takes 6 seconds, which while not
> exactly speedy, is tolerable. Unfortunately, for normal
> users the time is 32s. I have attached the EXPLAIN ANALYZE
> results and the plan looks reasonable. It wouldn't be too
> bad if the hit was taken just once, but everytime the page
> is loaded it takes 32s. Does anyone have any ideas about
> how to improve the performance? We are running RT-4.2.10
> with a PostgreSQL-9.4 backend.
> 
> Regards,
> Ken
> 


Re: [rt-users] mail solutions

2015-05-26 Thread Landon Stewart

> On May 26, 2015, at 11:18 AM, Terry O'Leary  wrote:
> 
> We have 14 different queues so using fetchmail to manage the email accounts 
> is useful for us. But that is where the problem lies as well I think. 
> Fetchmail doesn’t seem to be deleting the email from the inbox consistently. 
> Sometimes it works and sometimes it doesn’t. I have gone the route of working 
> with the Network Engineering team to see if there were any configuration 
> changes or updates to exchange that may have done but came up with nothing. 
> The emails get to their respective inboxes, then fetchmail (I have running in 
> a crontab every minute) executes to pick up and send any emails to RT 
> mailgate.:
> 
> Here is an example:
> 
> poll imap.corp.test.com <http://imap.corp.test.com/> proto IMAP and port 143:
> 
> # Team Queue
> username team  password 123456 mda 
> "/opt/rt4/bin/rt-mailgate --url http://test <http://test/> --queue 'Team 
> Requests' --action correspond"
> username team-comments password 123456 mda "/opt/rt4/bin/rt-mailgate --url 
> http://test <http://test/> --queue 'Team Requests' --action comment"
> 
> I know this isn’t a fetchmail forum, but any input would be gladly taken.

Just in case you are - I wouldn't cron it since you'll get duplicate processes 
checking the mailbox at the same time which would account for duplicates.  If 
you have to cron it though use flock to make sure more than one is never 
running at the same time:

/usr/bin/flock -n /tmp/fetchmail.lockfile /path/to/fetchmail -blahblahblah

I'm assuming you start fetchmail as a daemon instead of cron'd though.  If you 
are running fetchmail as a daemon make sure you use --uidl when starting the 
daemon in the /etc/init.d (or equivalent) something like this:

/usr/bin/fetchmail --uidl -f /etc/fetchmail.conf

-U | --uidl

   (Keyword: uidl)
   Force UIDL use (effective only with POP3).  Force client-side tracking 
of  'newness'  of  messages
   (UIDL  stands  for  "unique  ID  listing"  and is described in RFC1939). 
 Use with 'keep' to use a
   mailbox as a baby news drop for a group of users. The fact  that  seen  
messages  are  skipped  is
   logged,  unless  error  logging  is  done  through syslog while running 
in daemon mode.  Note that
   fetchmail may automatically enable this option depending on upstream  
server  capabilities.   Note
   also  that  this option may be removed and forced enabled in a future 
fetchmail version. See also:
   —idfile.


Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Configuring fetchmail to poll emails to respective queues.

2015-06-02 Thread Landon Stewart
> On Jun 2, 2015, at 9:12 AM, Rohit Gupta  wrote:
> 
> Dear All,
> I have configured new queue with ‘IT Support’ and configured want that any 
> emails coming to ithelpd...@syncoms.co.uk <mailto:ithelpd...@syncoms.co.uk> 
> should be fetched into this new queue. The snapshot of the new queue:
> 
> 
> So far, everything is running fine and emails are been received in the 
> ‘general’ queue. Now what do I need to do in order to configure rt such that 
> any emails coming to ithelpd...@syncoms.co.uk 
> <mailto:ithelpd...@syncoms.co.uk> comes in IT Support queue. As per few blogs 
> they are saying to add in /etc/aliases . can you please suggest as what do I 
> need to do – if I have to enter into the /etc/aliases then how my 
> configuration will look like?
>  At the moment, /etc/aliases is:
> 
>  And /etc/fetchmailrc:
>  
> Also, I have tried changing the –queue general to –queue ‘it support’ but it 
> didn’t work. Infact this time the requestor is receiving a mailer demon error 
> message.
> Please suggest. Thanks

Hi Rohit,

Since you are using fetchmail to get the mail and deliver it you do not need to 
modify your aliases.

Your —queue option is incorrect in your fetchmail configuration.  Use the name 
of the queue here.  Since it has spaces you'll have to use quotation marks.

…./rt-mailgate —queue "IT Support" —action correspond …etc...

Also -
Set your comment address to something else like 
(ithelpdesk-comme...@syncoms.co.uk <mailto:ithelpdesk-comme...@syncoms.co.uk>). 
 Setup another POP3 mailbox for that address.  Add that configuration to 
fetchmailrc but instead of using "correspond" for the action use "comment".

If the sender gets an email back instead of the email being created in the 
queue make sure you find out what it's saying back to them.  Also make sure you 
check:
- the fetchmail output (try running fetchmail manually in the foreground with 
verbose output)
- the RT log (usually /opt/rt4/var/log/rt.log)

Since this is a newly created queue it could be that everyone simply doesn't 
have permission to create tickets in the new queue.  Hard to say without more 
information.


Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] Configuring fetchmail to poll emails to respective queues.

2015-06-02 Thread Landon Stewart
> Your —queue option is incorrect in your fetchmail configuration.  Use the 
> name of the queue here.  Since it has spaces you'll have to use quotation 
> marks.

Oops, I should have mentioned you'll need to use single quotes instead of 
double quotes for the queue name since you are enclosing the whole command in 
double quotes.

Landon Stewart : lstew...@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [rt-users] single queue for multiple customers

2015-08-05 Thread Landon Stewart
In my opinion this would best be done with Constituencies but using a plugin 
for RT called RTIR.

https://www.bestpractical.com/docs/rtir/3.2.0/Constituencies.html

On Aug 4, 2015, at 11:54 PM, Asanka Gunasekera  
wrote:
> 
> Hi All, hope some one can give me some insight to below or refer to a UTL
> 
> Currently I am using RT as below (must be the must be the simplest way of 
> using).
> 
> 1. I have created a queue per each customer
> 2. and Create, admincc etc the customer and some internal supervisors
> 3. Each queue has its own reply address and comment address (both using the 
> same address)
> 
> Above set-up works fine, till my technical directer started saying otherwise 
> :) below is what he wants me to go about looking.
> 
> How can I have have signal queue for multiple customer and retain the same 
> level of access rights that I have with the current configuration.
> 
> Appreciate any help that you can provide
> 
> Best Regards
> 
> Asanka



Re: [rt-users] ExtractCustomFields for Ticket values

2015-09-01 Thread Landon Stewart
Just an FYI, it might simplify things in the future if you access things as 
directly as possible.  Some prefer to do this, some don't I guess.

For Example - instead of:
my $ticket = $self->TicketObj; $ticket->SetOwner($value)

You might do:
$self->TicketObj->SetOwner($value)

Or even:
$self->TicketObj->SetOwner(
$self->TransactionObj->Attachments->First->GetHeader('X-NEW-RT-OWNER')
);


On Sep 1, 2015, at 1:17 PM, Josh Coombs 
mailto:jcoo...@staff.gwi.net>> wrote:

Solved my own issue, I was mis-reading the error.  Final solution for the 
postcmd: my $ticket = $self->TicketObj; $ticket->SetOwner($value)|

Josh C

On Tue, Sep 1, 2015 at 2:46 PM, Josh Coombs 
mailto:jcoo...@staff.gwi.net>> wrote:
I'm working on switching from individual per Queue custom scrips in Perl to 
using ExtractCustomFields for populating ticket data on creation via incoming 
email.  So far I've gotten the basics working, but I'm running into a brick 
wall changing the ticket owner.

What we had as a scrip, pruned down to just setting the owner:

my $Ticket = $self->TicketObj;
my $Transaction = $self->TransactionObj;
my $Attachment = $Transaction->Attachments;
my $AttFirst = $Attachment->First;

my $NewRTOwner = $AttFirst->GetHeader('X-NEW-RT-OWNER');

$Ticket->SetOwner($NewRTOwner);

With ExtractCustomFields I've setup the standard scrip with the following 
template:

|X-NEW-RT-OWNER|.*|$RT::Ticket->SetOwner($value)|

With debug logging lit, the post command is failing saying method SetOwner 
can't be called on an undefined value.  I can see that $value is getting 
correct set from the debug leading up to that failure, so I suspect this is a 
scope error on my part?

Any guidance would be greatly appreciated.

Josh C




Re: [rt-users] RT 4.2.12 and CentOS 7

2015-09-02 Thread Landon Stewart
On Sep 2, 2015, at 10:23 AM, Tom Misilo 
mailto:misi...@fit.edu>> wrote:

Hi,

I was wondering if anyone has successfully used “make fixdeps” with Request 
Tracker on CentOS 7? As it seems like cpan only installs to the local users 
home directory in a ~/perl5 folder and not systemwide. Which when using Request 
Tracker and mod_fcgid  apache does not find any of the modules.

Are you running 'make fixdeps' as root privileges?



Landon Stewart : lstew...@iweb.com<mailto:lstew...@iweb.com>
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com : +1 (888) 909-4932



[rt-users] Please help with RT::Authen::ExternalAuth with nested LDAP/AD groups

2016-07-14 Thread Landon Stewart
Hello,

I have a working mod_authnz_ldap configuration for apache 2.4 (on a virtualhost 
on the same server) but I cannot seem to convert the configuration to a valid 
RT::Authen::ExternalAuth::LDAP configuration.  At one point I could see in 
var/log/rt.log that it was at least checking the nested groups for membership 
but the filter didn't look quite right.  I have since changed that 
configuration and it seems to stall for a minute and then fail.  It gets my 
real name from the AD service but then cannot match the sub/nested group filter 
I think?

The apache configuration that works is:

LogLevel debug
AuthName "Password protected. Enter your AD username and password."
AuthType Basic
AuthBasicProvider ldap
AuthLDAPURL 
"ldap://ldap.server.hostname/OU=iweb,DC=corp,DC=iweb,DC=com?sAMAccountName?sub?(objectClass=*)"
AuthLDAPGroupAttribute member
AuthLDAPGroupAttributeIsDN on
AuthLDAPBindDN "ldapbinduserstring"
AuthLDAPBindPassword ldapbindpass
Require ldap-filter 
memberOf:1.2.840.113556.1.4.1941:=CN=RTIR_WEB_SC_ACCESS,OU=Groupes,OU=iWeb,DC=corp,DC=iweb,DC=com



So far I've got this in RT_SiteConfig.pm for RT:
...snipped...
Set($ExternalSettings, {
'My_LDAP' => {
'type' => 'ldap',
'server' => 'corp.iweb.com<http://corp.iweb.com>',
'user' => 'ldapbinduserstring',
'pass' => 'ldapbindpass',
'base' => 'OU=iweb,DC=corp,DC=iweb,DC=com',
'filter' => '(objectClass=*)',
'd_filter' => 'UserAccountControl:1.2.840.113556.1.4.803:=2',
'group' => 'RTIR_WEB_SC_ACCESS',
'group_scope' => 'sub',
'group_attr' => 
'memberOf:1.2.840.113556.1.4.1941:=CN=RTIR_WEB_SC_ACCESS',
'group_attr_value' => 'OU=Groupes,OU=iWeb,DC=corp,DC=iweb,DC=com',
'tls' => 0,
'attr_match_list' => [
'Name',
'EmailAddress',
],
'attr_map' => {
'Name' => 'sAMAccountName',
'EmailAddress' => 'mail',
'Organization' => 'physicalDeliveryOfficeName',
'RealName' => 'cn',
'ExternalAuthId' => 'sAMAccountName',
'Gecos' => 'sAMAccountName',
},
},
} );
...snipped...
Plugin('RT::IR', 'RT::Authen::ExternalAuth');

The log entries with the above configuration are:
[28280] [Thu Jul 14 19:12:14 2016] [debug]: Attempting to use external auth 
service: My_LDAP 
(/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth.pm:424)
[28280] [Thu Jul 14 19:12:14 2016] [debug]: Calling UserExists with $username 
(lstewart) and $service (My_LDAP) 
(/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth.pm:465)
[28280] [Thu Jul 14 19:12:14 2016] [debug]: UserExists params:
username: lstewart , service: My_LDAP 
(/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:439)
[28280] [Thu Jul 14 19:12:14 2016] [debug]: LDAP Search ===  Base: 
OU=iweb,DC=corp,DC=iweb,DC=com == Filter: 
(&(objectClass=*)(sAMAccountName=lstewart)) == Attrs: 
sAMAccountName,physicalDeliveryOfficeName,mail,cn,sAMAccountName,sAMAccountName 
(/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:469)
[28280] [Thu Jul 14 19:12:14 2016] [debug]: Password validation required for 
service - Executing... 
(/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth.pm:517)
[28280] [Thu Jul 14 19:12:14 2016] [debug]: Trying external auth service: 
My_LDAP 
(/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:153)
[28280] [Thu Jul 14 19:14:14 2016] [debug]: LDAP Search ===  Base: 
OU=iweb,DC=corp,DC=iweb,DC=com == Filter: 
(&(sAMAccountName=lstewart)(objectClass=*)) == Attrs: 
dn,OU=Groupes,OU=iWeb,DC=corp,DC=iweb,DC=com 
(/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:186)
[28280] [Thu Jul 14 19:14:14 2016] [debug]: Found LDAP DN: CN=Landon 
Stewart,OU=Utilisateurs,OU=iWeb,DC=corp,DC=iweb,DC=com 
(/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:220)
[28280] [Thu Jul 14 19:14:15 2016] [debug]: Attribute 
'OU=Groupes,OU=iWeb,DC=corp,DC=iweb,DC=com' has no value; falling back to 
'CN=Landon Stewart,OU=Utilisateurs,OU=iWeb,DC=corp,DC=iweb,DC=com' 
(/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:249)
[28280] [Thu Jul 14 19:14:15 2016

Re: [rt-users] Recover original scripts in RT

2016-07-15 Thread Landon Stewart

On Jul 15, 2016, at 10:41 AM, yugi 
mailto:uriboxmob...@gmail.com>> wrote:

That one i tried already



Are the emails that are not being CC'd or BCC'd coming into RT via email or are 
they being composed and sent from the RT interface?

--
Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
📧 lstew...@internap.com<mailto:lstew...@internap.com>
🌍 www.internap.com<http://www.internap.com>

-
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Los Angeles - September, 2016


Re: [rt-users] Please help with RT::Authen::ExternalAuth with nested LDAP/AD groups

2016-07-15 Thread Landon Stewart
On Jul 15, 2016, at 11:03 AM, Nilesh 
mailto:m...@nileshgr.com>> wrote:

Your setup looks perfectly fine, but I may be missing something because I
haven't used AD. I use OpenLDAP with rt-ldapimport script for authentication and
rt-ldapimport --no-users --import to sync users (enabled Group member syncing in
the importer). Works good. May be give that a try?

I guess my next step would be figuring out how to sync the groups so that our 
RTIR_WEB_SC_ACCESS group users would be within the "DutyTeam" group in RTIR.  I 
believe you are right in that rt-ldapimport would help with that I think but it 
looks like a nightmare to set up.  I'll burn that barn down when I come to it I 
guess.

I think my issues with authentication lay within the following part of the 
configuration.  I'm not sure what the group* configuration variables are for 
exactly because they are loosely documented and there are I've found very few 
examples via google and (almost?) none related to nested groups.

'base' => 'OU=iweb,DC=corp,DC=iweb,DC=com',
'filter' => '(objectClass=*)',
'd_filter' => 'UserAccountControl:1.2.840.113556.1.4.803:=2',
'group' => 'RTIR_WEB_SC_ACCESS',
'group_scope' => 'sub',
'group_attr' => 
'memberOf:1.2.840.113556.1.4.1941:=CN=RTIR_WEB_SC_ACCESS',
'group_attr_value' => 'OU=Groupes,OU=iWeb,DC=corp,DC=iweb,DC=com',

--
Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
📧 lstew...@internap.com<mailto:lstew...@internap.com>
🌍 www.internap.com<http://www.internap.com>

-
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Los Angeles - September, 2016


Re: [rt-users] Recover original scripts in RT

2016-07-18 Thread Landon Stewart
On Jul 15, 2016, at 10:32 AM, yugi 
mailto:uriboxmob...@gmail.com>> wrote:

Hi
I have one RT that is in production, that had suffer some deletes on the 
scripts that do the send of the emails …

I tried to create new ones to do RT send emails in CC and BCC again but without 
success.

It sounds like you just need to recreate the global Scrip that does this:

[cid:83379900-285D-4257-B334-5A7854A16D06@corp.iweb.com]

--
Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
📧 lstew...@internap.com<mailto:lstew...@internap.com>
🌍 www.internap.com<http://www.internap.com>

-
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Los Angeles - September, 2016


Re: [rt-users] How to backup/dump Postgre SQL

2016-08-05 Thread Landon Stewart
On Aug 5, 2016, at 4:05 AM, Martin Petersson 
mailto:mar...@uanet.se>> wrote:

Hello,

I need to backup or dump the database to a .bak file, it´s Request Tracker 
4.0.7.
Frits i tried this:
root@rt:~# pg_dump rtdb > rtdb-backup
pg_dump: [archove (db)] connection against database "rtdb" failed: FATAL:  role 
"root" does not exist

Then i tried:
root@rt:~# su postgres
postgres@rt:/root$ pg_dump rtdb > rtdb-backup
bash: rtdb-backup: Access denied

What do i have to do to create a backup of the database?

Use 'su - postgres' instead to become postgres instead of just get the 
permissions of postgres.  If that doesn't work because it doesn't have a shell 
try sudo but ultimately you need to be in a place you can write to while having 
the permissions of postgres or specify the location in the redirect.

eg:
# su postgres
$ pg_dump rtdb -> /tmp/rtdb-backup

--
Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
📧 lstew...@internap.com<mailto:lstew...@internap.com>
🌍 www.internap.com<http://www.internap.com>

-
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Los Angeles - September, 2016


Re: [rt-users] How to backup/dump Postgre SQL

2016-08-05 Thread Landon Stewart
eg:
# su postgres
$ pg_dump rtdb -> /tmp/rtdb-backup

OOPS
# su postgres
$ pg_dump rtdb > /tmp/rtdb-backup

--
Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
📧 lstew...@internap.com<mailto:lstew...@internap.com>
🌍 www.internap.com<http://www.internap.com>

-
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Los Angeles - September, 2016


Re: [rt-users] Query for custom fields using 'NOT LIKE' is no longer working

2016-09-07 Thread Landon Stewart
On Sep 7, 2016, at 5:01 AM, Keith Creasy 
mailto:kcre...@aph.org>> wrote:

Hi everyone.

We are using RT 4.2.7. I think this used to work but now it isn’t. In a query 
like this:

Queue = 'Nimas' AND Priority > 49 AND (  Status = 'new' OR Status = 'open' OR 
Status = 'development' ) AND Due > 0 AND CF.{Type} NOT LIKE ‘Epic’

The “NOT LIKE” operator doesn’t work. I’ve tried it using the Query Builder and 
using Advanced. The “LIKE” operator does work. Does anyone have an idea for 
solving this?


I'm not sure if this means anything but on my screen the single quotes around 
the word Epic are different than the other words that have single quotes.

'development'
vs
‘Epic’

[cid:B1747A7F-2B3B-409D-9B0F-63C79811C7FC@telus]

--
Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
📧 lstew...@internap.com<mailto:lstew...@internap.com>
🌍 www.internap.com<http://www.internap.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] Emails causing duplicate tickets?

2016-09-07 Thread Landon Stewart
On Sep 7, 2016, at 10:13 AM, Alex Hall 
mailto:ah...@autodist.com>> wrote:

Hi all,
I just ran into a very odd problem. I opened a ticket via email, which worked. 
But I then saw three more tickets open from that same email, each at the next 
mail polling. I haven't seen this problem before, and I don't know where to 
look to tell RT what to do with fetched emails. As I said, I only just started 
seeing this, which means I must have changed something. All I did was add a few 
more queues to my fetchmailrc file, though. Are there fetchmail options I 
should add, or is this an RT setting? If the latter, is it in the web UI or 
somewhere in a configuration file? Thanks for any help.

Is fetchmail being told to delete mail from the mailbox after it has been 
fetched?  Deleting mail from the mailbox is the default behaviour AFAIK.  In 
any event, with or without deleting mail after it is fetched you'll probably 
want to use the 'uidl' keyword in your configuration to keep track of what 
messages are considered new on your side of things instead of relying on the 
server to decide what's new and what's not.

From 'man 1 fetchmailrc':

   -U | --uidl
  (Keyword: uidl)
  Force UIDL use (effective only with POP3).  Force client-side 
tracking of 'newness' of messages (UIDL stands for "unique ID listing"
  and  is  described  in RFC1939).  Use with 'keep' to use a 
mailbox as a baby news drop for a group of users. The fact that seen mes‐
  sages are skipped is logged, unless error logging is done through 
syslog while running in daemon  mode.   Note  that  fetchmail  may
  automatically  enable  this  option depending on upstream server 
capabilities.  Note also that this option may be removed and forced
      enabled in a future fetchmail version. See also: --idfile.

--
Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
📧 lstew...@internap.com<mailto:lstew...@internap.com>
🌍 www.internap.com<http://www.internap.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] FW: Query for custom fields using 'NOT LIKE' is no longer working

2016-09-07 Thread Landon Stewart
On Sep 7, 2016, at 2:57 PM, Keith Creasy 
mailto:kcre...@aph.org>> wrote:

Apologies. I keep forgetting that replies to this list go to the sender and not 
to the list…


From: Keith Creasy
Sent: Wednesday, September 7, 2016 5:55 PM
To: 'Hien Ly' mailto:hien.thai...@gmail.com>>
Subject: RE: [rt-users] Query for custom fields using 'NOT LIKE' is no longer 
working

Hi. I think I now know the problem but haven’t confirmed it yet.

We just created a new queue for requests submitted by beta testors. It’s sort 
of an approval queue though we are not using the built-in __approval queue, 
it’s just a regular queue. A “Type” custom field was created in it with 
different values from the existing Type field. I suspect that RT is matching 
the first field with the name CF.{Type} it finds. The reason is that if you use 
the field id CF.{11} it works.

CF.{11} NOT LIKE ‘Epic’

If this is a solution I’ll let you know but it is equally strange that “LIKE” 
works while “NOT LIKE” does not.

Is this a bug in RT?

I try to apply a single CF to multiple queues if it has the same name so it is 
treated the same.  Apart from that though - do you need to use LIKE?  Can you 
use != instead?  eg. CF.{cfname} != 'EPIC'.  I wonder if you have the same 
problem using != instead but yeah it does sound like a bug to me.  I did notice 
that you had strange quotations again though but I trust you are just using 
regular single quotes in actuality.

CF.{11} NOT LIKE ‘Epic’

--
Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
📧 lstew...@internap.com<mailto:lstew...@internap.com>
🌍 www.internap.com<http://www.internap.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

  1   2   >