Re: [rt-users] RT send 2 mail notification for setting the ticket owner

2015-05-13 Thread Rabin Yasharzadehe
On Tue, May 12, 2015 at 8:06 PM, Bill Cole <
rtusers-20090...@billmail.scconsult.com> wrote:

> Based on what you posted, I would expect there to be 2 different scrips,
> one for each message. Your solution will probably involve selecting one of
> them to keep and disabling the other.
>
>  but it is not familiar
>> to me,
>> the condition is "User defined" but i can't understand the Perl code,
>>
>> can you help please ?
>>
>> 
>> my $txn = $self->TransactionObj;
>> return 0 unless $txn->Field eq "Owner";
>> return 0 if $txn->NewValue == $txn->Creator;
>> return 1;
>> 
>>
>
> That means the scrip action (sending an email notification using the
> selected template) will trigger only on transactions that (1) change the
> ticket's "Owner" field and (2) set the new value of "Owner" to a value that
> is not equal to the "Creator" field of the transaction. In other words: the
> scrip triggers when a user gives a ticket to someone else.
>

​Thank you :)
​​

--
Rabin


Re: [rt-users] RT send 2 mail notification for setting the ticket owner

2015-05-11 Thread Rabin Yasharzadehe
On Sun, May 10, 2015 at 7:45 PM, Bill Cole <
rtusers-20090...@billmail.scconsult.com> wrote:

> On 10 May 2015, at 5:41, Rabin Yasharzadehe wrote:
>
>  First mail looks like this,
>>
>> Sun May 10 12:27:14 2015: Request 242534 was acted upon.
>>
>>> Transaction: Given to rabin by X
>>> Queue: sandbox
>>> Subject: *(No subject given)*
>>> Owner: rabin
>>> Requestors: rabin
>>> Status: new
>>> Ticket: https://rt
>>>
>>>
>> ​the 2nd mail notification look like this,
>>
>> Sun May 10 12:27:14 2015: Request 242534 was acted upon.
>>
>>> Transaction: Owner set to rabin by X
>>> Queue: sandbox
>>> Subject: *(No subject given)*
>>> Owner: rabin
>>> Requestors: rabin
>>> Status: new
>>> Ticket: https://rt
>>>
>>
>>
>> ​why is that ? ​
>>
>
> You have 2 different scrips being triggered by the same transaction. You
> can find which scrip is sending which message by looking at the Message-Id
> header. An example from my system:
>
> Message-ID: 
>
> That's: rt-version-Trans-EpochSec-msecs-Ticket-Scrip-MailSeq@hostname


​Thank you Bill,
your tip was very helpful (and probably also in the future)​

I found the scrip which send the email notification, but it is not familiar
to me,
the condition is "User defined" but i can't understand the Perl code,

can you help please ?


my $txn = $self->TransactionObj;
return 0 unless $txn->Field eq "Owner";
return 0 if $txn->NewValue == $txn->Creator;
return 1;



​



--
Rabin


[rt-users] RT send 2 mail notification for setting the ticket owner

2015-05-10 Thread Rabin Yasharzadehe
First mail looks like this,

Sun May 10 12:27:14 2015: Request 242534 was acted upon.
> Transaction: Given to rabin by X
> Queue: sandbox
> Subject: *(No subject given)*
> Owner: rabin
> Requestors: rabin
> Status: new
> Ticket: https://rt
>

​the 2nd mail notification look like this,

Sun May 10 12:27:14 2015: Request 242534 was acted upon.
> Transaction: Owner set to rabin by X
> Queue: sandbox
> Subject: *(No subject given)*
> Owner: rabin
> Requestors: rabin
> Status: new
> Ticket: https://rt


​why is that ? ​


​current RT version = 4.2.10
installed from source on ubuntu 12.04​


--
Rabin


Re: [rt-users] Slow Query on RT 4.2.4 after upgrade from 4.0

2014-05-25 Thread Rabin Yasharzadehe
>From RT Wiki: FAQ Page In most case it's a problem with User/Groups rights
that makes too much users appears in the select owner dropdown. If this
dropdown seems to contains more than wanted people, then check everywhere
(Global rights/ Queue rights) in RT rights to see if OwnTicket right is not
granted to Everyone, Unprivileged or a group that shouldn't have this right
and contains many people. You can also run the following SQL query on the
RT database to find each objects that grant OwnTicket:

SELECT  *
FROM  ACL
where 
RightName='OwnTicket';

 e.g:


   1.
   mysql> SELECT
 * FROM
 ACL where

RightName='OwnTicket';
   2.
   3. 
+-+---+-+---++--+-+-+---+-+
   4. | id  | PrincipalType | PrincipalId | RightName | ObjectType |
ObjectId | Creator | Created | LastUpdatedBy | LastUpdated
|
   5. 
+-+---+-+---++--+-+-+---+-+
   6. | 316 | Group |  50 | OwnTicket | RT::Queue  |
 1 |   0 | NULL

| 0 | NULL

|
   7. ..
   8. ..
   9.
   ..
   10. | 557 | Group |  50 | OwnTicket | RT::Queue  |
 27 |  12 | 2012-06-03 13:07:19 |12 | 2012-06-03
13:07:19 |
   11. | 669 | AdminCc   |  271319 | OwnTicket | RT::Queue  |
 28 |  12 | 2012-06-03 14:06:24 |12 | 2012-06-03
14:06:24 |
   12. | 723 | Owner |  271321 | OwnTicket | RT::Queue  |
 28 |  12 | 2012-06-03 14:06:24 |12 | 2012-06-03
14:06:24 |
   13. | 911 | Group |  349063 | OwnTicket | RT::Queue  |
 33 |  12 | 2013-02-26 10:57:44 |12 | 2013-02-26
10:57:44 |
   14. 
+-+---+-+---++--+-+-+---+-+

 Here OwnTicket is granted to Owner on queue "28". Check this on the UI:
https://rt/Admin/Queues/GroupRights.html?id=28


I also found that adding index to several more
tableswill
speed up shredder as well,




--
Rabin


On Fri, May 23, 2014 at 7:11 PM, Patrick Muldoon  wrote:

> Recently upgraded from 4.0 to 4.2 and have noticed that we are now getting
> slow queries on pretty much all ticket history queries.   I ’ve been
> reading the list and attempting to google but I cannot seem to figure out
> what the cause is.
>
> This RT database started life 11 years ago and has been dragged along from
> upgrade to upgrade and this is the first time we’ve run into any real
> issue.   I’ve compared our Schema with a freshly installed version of 4.2
> and don’t see any indexes missing, or anything along those lines.
>
> I think that it has something to do with the way either have groups setup,
> or permissions, since if I make my account an admin/super user all the
> queries are super fast..
>
> We are running on postgresql 9.3.4
>
> here is the query that is causing us issues..
>
> SQL(20.280673s):
>
> SELECT COUNT(DISTINCT main.id)
>   FROM Tickets main
>   JOIN Groups Groups_1  ON ( LOWER(Groups_1.Domain) = 'rt::ticket-role' )
> AND ( LOWER(Groups_1.Name) = 'requestor' ) AND ( Groups_1.Instance =
> main.id )
>   JOIN Groups Groups_3  ON ( LOWER(Groups_3.Domain) = 'rt::ticket-role' )
> AND ( Groups_3.Instance = main.id )
>   JOIN CachedGroupMembers CachedGroupMembers_2  ON (
> CachedGroupMembers_2.Disabled = '0' ) AND ( CachedGroupMembers_2.GroupId =
> Groups_1.id )
>   LEFT JOIN CachedGroupMembers CachedGroupMembers_4  ON (
> CachedGroupMembers_4.Disabled = '0' ) AND ( CachedGroupMembers_4.MemberId =
> '22' ) AND ( CachedGroupMembers_4.GroupId = Groups_3.id )
>   WHERE (
>   (
>( main.Queue = '1' OR main.Queue = '4' OR main.Queue = '5' )  OR
>( main.Owner = '22' AND main.Queue = '2' )  OR
>( CachedGroupMembers_4.MemberId IS NOT NULL AND
> LOWER(Groups_3.Name) = 'admincc' AND main.Queue = '2' )
>   )
> )
> AND (main.IsMerged IS NULL)
> AND (main.Status != 'deleted')
> AND (main.Type = 'ticket')
> AND (
>   ( CachedGroupMembers_2.MemberId = '364' )  AND
>   ( LOWER(main.Status) = 'new' OR LOWER(main.Status) = 'open'
> OR LOWER(main.Status) = 'stalled' )
> )
>
>
> And then the nex

[rt-users] Fwd: Adding Index to several tables to improve shredder performance

2013-04-23 Thread Rabin Yasharzadehe
Hello list,

 In preparation for transferring our RT server to a new server
I started to clean up RT using the shredder tool,

For starters, I shred old tickets marked as deleted (mostly spam),

# ./rt-shredder --plugin "Tickets=query,Status = 'Deleted' AND LastUpdated
> < '30 days ago';limit,100" --sqldump /opt/shredder-restore-tickets-`date
> +%s`.sql --force


And the next step was deleting users who have no tickets

# ./rt-shredder --plugin
> "Users=no_tickets,1;status,any;replace_relations,Nobody;limit,25" --sqldump
> /opt/shredder-restore-tickets-`date +%s`.sql --force


Running the following commands from the command line would take me about
two hours to finish.

I'm no database expert, but i start searching around and enabled slow query
login for MySQL and i found out that the script hang a lot on query on the
Attachment table, the problem seemed to be a missing index for the
creator column.

mysql> ALTER TABLE  `Attachments` ADD INDEX (  `Creator` )


After adding the above indexing for this column, the deletion time dropped
to less than 5 minutes

Given the success of the above method, I used it on other tables,
and found few more places that I can add indexing to improve shredder
timing.

ALTER TABLE  `Transactions`ADD INDEX (  `Creator`   )
> ALTER TABLE  `ObjectCustomFieldValues` ADD INDEX (  `ObjectType`)
> ALTER TABLE  `ObjectCustomFieldValues` ADD INDEX (  `ObjectId`  )
> ALTER TABLE  `Groups`  ADD INDEX (  `LastUpdatedBy` )
> ALTER TABLE  `Principals`  ADD INDEX (  `PrincipalType` )
> ALTER TABLE  `CachedGroupMembers`  ADD INDEX (  `Via`   )
> ALTER TABLE  `GroupMembers`ADD INDEX (  `LastUpdatedBy` )
> ALTER TABLE  `Groups`  ADD INDEX (  `Creator`   )
> ALTER TABLE  `Tickets` ADD INDEX (  `Creator`   )


My question is,
can i leave the above index ?
can those changes disturb or harm future upgrades of RT ?

Thanks in advance,
--
​​
Rabin Yasharzadehe


[rt-users] Disable autoreply for tickets created via the web interface

2013-04-09 Thread Rabin Yasharzadehe
Hello list,

I'm trying to find a way to disable the Auto-Reply message when we open a
ticket for some else from the web interface (we set there email in the
requestors field),  so that we only send a auto-reply message for tickets
created via mail submission.

Running: RT 4.0.5

--
Rabin Yasharzadehe


Re: [rt-users] Shredder location

2012-07-01 Thread Rabin Yasharzadehe
If you about to shred a lot of data use the CLI and not the web-interface

*---
Rabin Yasharzadehe*



On Fri, Jun 29, 2012 at 9:19 PM, Chris Preston  wrote:

>  Hello all,
>
> I am trying to shred some tickets data and when I click on the shredder
> icon, I get a message
>
> ** **
>
> Shredder needs a directory to write dumps to. Please check that you have
> /opt/rt3/var/data/RT-Shredder and it is
> writable by your web server. 
>
> ** **
>
> I created a folder opt/rt3/var/data/RT-Shredder but when I re run I still
> get the message.  What else do I need to do
>
> ** **
>
> Regards
>
> ** **
>


Re: [rt-users] RT 3.8.0 DB migrate to 4.0.5 - Errors Please help!

2012-06-20 Thread Rabin Yasharzadehe
Did the same thing, i used this guide as a base
http://www.math.ias.edu/~tarzadon/pages/posts/migrating-rt-3.6.4-to-rt-4.0-88.php

but it didn't dump and restore the DB, it was big and slow, so i just copy
the DB files
from Debian 5 server to a new (Virtual) Debian 6 server and fixed the DB
(you'll get ERROR 1577 for MySQL)

ERROR 1577 (HY000) at line 1: Cannot proceed because system tables used by
> Event Scheduler were found damaged at server start


You'll need to run this command to fixit

sudo mysql_upgrade -u root -h localhost -p --verbose --force


then I created the ALTER SQL-Queries && Upgrade the DB schema

perl /opt/rt/rt-4.0.5/etc/upgrade/upgrade-mysql-schema.pl rt3-database
> dbuser dbpassword  > /opt/rt/queries.sql
> mysql -u root -p rt3-database < /opt/rt/queries.sql



*---
Rabin Yasharzadehe*



On Tue, Jun 12, 2012 at 9:23 PM, FrankOh  wrote:

>
> OK i've searched all over the Internet and I can't seem to fix the problem.
> Currently in production we have RHEL (kernel 2.6.18-238.9.1.el5) with
> RT3.8.0 installed on mySQL 5.0.77. We want to move RT off of this physical
> box and put it on VM. At the same time upgrade to the latest RT 4.0.5.
>
> What I have done so far:
> - Got a backup of our DB in production using mysqldump
> - Created the brand new environment. Tried two different distros. Debian
> (Squeeze) was by far the easiest using all the tutorials and aptitude.
> Kernel 2.6.32-5-amd64 with RT 4.0.5 and mysql 5.1.61-0+squeeze1. Also
> created a Centos 6.2 (kernel 2.6.32-220.el6.x86_64) environment with RT
> 4.0.5 and mySQL 5.1.61.
> - In both cases, RT 4.0.5 was working without any issues after the initial
> install. Then I deleted the "sample" DB, created a new empty db (rtdb) and
> imported the mySQL dump from production:
>
> "mysql --max_allowed_packet=512M -u root -p rtdb < rt.sql"
>
> After the import was complete, if i had a session open from before.. i can
> actually browse the RT site and see all my old information.. cool. Then I
> did the upgrade using the RT scripts. Since I am not migrating from prior
> 3.8.0 and I am not moving from mySQL 4.0 to 4.1, I do not need to apply the
> mySQL scripts in the README. All i did after this import was:
>
> "rt-setup-database --prompt-for-dba-password --action upgrade"
>
> After a couple prompts ("current version" 3.8.0", etc) it did its upgrade
> process. I didn't get any errors.. however i did get some warnings.
> Something about if you're not using something then don't worry about it.
>
> [Sat Jun  9 20:36:36 2012] [warning]: Going to add [OLD] prefix to all
> templates in approvals queue. If you have never used approvals, you can
> safely delete all the templates with the [OLD] prefix. Leave the new
> Approval templates because you may eventually want to start using
> approvals.
> (./etc/upgrade/3.8.2/content:3)
> [Sat Jun  9 20:37:01 2012] [warning]: IMPORTANT: We're going to delete all
> scrips in Approvals queue and save them in 'rt-approvals-scrips-cxYO' file.
> (./etc/upgrade/3.8.2/content:165)
>
> [Sat Jun  9 20:37:30 2012] [warning]: Couldn't set SortOrder: That is
> already the current value (./etc/upgrade/3.8.8/content:32)
> [Sat Jun  9 20:37:30 2012] [warning]: Couldn't set SortOrder: That is
> already the current value (./etc/upgrade/3.8.8/content:32)
>
> The upgrade finished without a hitch. Now i see 26 tables in my DB (3.8.0,
> there were 21). Now again, i can browse the RT site with my imported data.
>
> Now the error
>
> When i restart the box.. or even restart apache (httpd in Centos and
> apache2
> in Debian).. i get weird errors.
>
> Debian box (Squeeze):
> root@rt-migrate:~# service apache2 restart
> Restarting web server: apache2RT since version 3.8 has new schema for MySQL
> versions after 4.1.0
> Follow instructions in the UPGRADING.mysql file.
>
> [Wed May 30 14:44:45 2012] [warning]:   (in cleanup) Error while loading
> /usr/share/request-tracker4/libexec/rt-server: ModPerl::Util::exit:
> (12)
> exit was called at /usr/share/request-tracker4/libexec/rt-server line 135
> at
> /usr/share/perl5/Plack/Util.pm line 156.
> (/usr/share/request-tracker4/lib/RT.pm:353)
>  ... waiting RT since version 3.8 has new schema for MySQL versions after
> 4.1.0
> Follow instructions in the UPGRADING.mysql file.
>
> [Wed May 30 14:44:48 2012] [warning]:   (in cleanup) Error while loading
> /usr/share/request-tracker4/libexec/rt-server: ModPerl::Util::exit:
> (12)
> exit was called at /usr/share/request-tracker4/libexec/rt-server line 135
> at
> /usr/share/perl5/Plack/Util.pm line 156.
> (/usr/share/request-tracker4/lib/RT.pm:353)
>
> De

[rt-users] Exclude mails and domain from Autoreply

2012-06-06 Thread Rabin Yasharzadehe
I looked in the wiki and found this page:
http://requesttracker.wikia.com/wiki/OnCreateAutoReplyException
Just like in the article, we have some automated systems that send mails to
RT, and we don't need to auto-reply to them.
I put code in the "*Custom condition"* of the auto-reply scrip for a
specific queue, but it didn't work

My RT setup is: RT v4.0.5 , Running on Debian 6 and Apache with fcgid

*---
Rabin Yasharzadehe*


Re: [rt-users] Integrating with Active Directory

2012-05-29 Thread Rabin Yasharzadehe
If you staring from scratch why not going with 4.0.6 ?

but you can always start from the wiki page
* http://requesttracker.wikia.com/wiki/ExternalAuth
* http://requesttracker.wikia.com/wiki/ExternalAuthentication

And google for more in the archive for e.g
http://www.gossamer-threads.com/lists/rt/users/108225

*---
Rabin Yasharzadehe*



On Tue, May 29, 2012 at 9:58 AM, Varun Naik  wrote:

> Hello All,
>
> I have installed RT 3.8.7, I trying to integrate with Active Directory.
> Please guide me how do I integrate with AD.
>
> --
> Thanks & Regard,
> Varun.V.Naik
>
>


Re: [rt-users] No drop-down for Articles in 4.0.5

2012-05-15 Thread Rabin Yasharzadehe
I just finish doing this,

use the documentation file
@ /opt/rt4/docs/customizing/articles_introduction.pod
when you create a CLASS mark the checkbox for "All Articles in this class
should be listed in a dropdown of the ticket reply page"

make sure you set the group permissions to allow users to see&use
the article in the dropdown menu
as well for the custum fields used in each article.

*---
Rabin Yasharzadehe*



On Mon, May 14, 2012 at 6:46 PM, Max McGrath  wrote:

> We just upgraded our test environment from 3.8.8 to 4.0.5.  In 3.8.8, when
> you resolved (or replied to, etc...) a ticket, we had the *Select an
> Article to include* drop-down option that would use an Article from RTFM
> and drop them right in the ticket.
>
> In 4.0.5, I am not seeing this option.  When I'm resolving a ticket, I see
> the *Search for Articles matching* and *Include Article:* options (which
> I'm not exactly sure how to use either...), but no drop-downs.  In each
> Article class I have checked the *All Articles in this class should be
> listed in a drop-down of the ticket reply page* option, but I am not
> seeing them.
>
> I've checked in IE, Firefox and Chrome -- but no dropdown.  Am I missing
> something?  I've checked the permissions -- I don't believe they are the
> cause.
>
> Thanks!
> --
> Max McGrath
> Network Administrator
> Carthage College
> 262-552-5512
> mmcgr...@carthage.edu
>


Re: [rt-users] Keep some HTML tags attributes

2012-05-01 Thread Rabin Yasharzadehe
Thank you for your reply,

Sorry for now mentioning this before,
I just finish to "upgrade" our old RT system from v3.6.7 to the latest 4.0.5
and we really liked to use all the new HTML features that this new release
come with.

I just patched the mention file in your link, and it WORKS,
I'm really grateful for your quick reply.

*---
Rabin Yasharzadehe*



On Tue, May 1, 2012 at 4:46 PM, Thomas Sibley  wrote:

> On 05/01/2012 07:21 AM, Rabin Yasharzadehe wrote:
> > Hello list,
> >
> > I enabled HTML for my templates and in SiteConfig enabled
> >
> > Set($PreferRichText, true);
> > Set($TrustHTMLAttachments, 1);
> >
> >
> > But, I'm looking for a way to allow some HTML attributes into RT tickets,
> > specifically to allow the dir="RTL" attribute
>
> RT 4.0.6 will allow these attributes.
>
> https://github.com/bestpractical/rt/commit/a625c19e
>
> > right now RT strip some of the attributes e.g it's not removing all
> > the attributes of the font tag
> > from where can I control this behavior ?
>
> You don't say what RT version you're using, and the answer depends on that.
>
> Thomas
>


Re: [rt-users] Keep some HTML tags attributes

2012-05-01 Thread Rabin Yasharzadehe
Hello list,

I enabled HTML for my templates and in SiteConfig enabled

Set($PreferRichText, true);
> Set($TrustHTMLAttachments, 1);


But, I'm looking for a way to allow some HTML attributes into RT tickets,
specifically to allow the dir="RTL" attribute

right now RT strip some of the attributes e.g it's not removing all
the attributes of the font tag
from where can I control this behavior ?

Thanks,

*---
Rabin Yasharzadehe*