[rt-users] Custom authentication script fails with ExternalAuthPriority not defined, please check your configuration file

2013-01-13 Thread Scotto Alberto
Hi Thomas,

a part from using REST, which is undoubtably the best solution for my problem..
Back to the design debate about input validation..

I wrongly talked about the View layer as the place to validate the input.
Now I have the correct answer: the right place for that is the Model.

A nice example is in CakePHP, where the method 'validate' of the Model class is 
charged with the input validation.
http://api20.cakephp.org/class/model#method-Modelvalidates

That's the one and only single point to fix.

The backend is a single point to fix, whereas validation might
 need to happen across multiple views and interfaces.

It's true that we may have multiple views that get the same input from the 
user, but we are likely to have multiple backend functions, that use that same 
input, as well.

So, instead of validating the input in every backend function, it's much 
cleaner to write those low-level functions assuming the input has already been 
validated as a precondition.

 The path of shoving the shell_exec() validation up into the view is
 lined with awful websites which prohibit special characters in passwords.

That's possible, but please don't compare me to one of those.
Thanks


Da: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Thomas Sibley 
[t...@bestpractical.com]
Inviato: giovedì 3 gennaio 2013 1.08
A: rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] R: R: R: Custom authentication script fails with  
ExternalAuthPriority not defined, please check your configuration file



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

On 01/02/2013 03:53 PM, Scotto Alberto wrote:
 Fix problems at the source

 Exactly. From my point of view, the source is who/what generates
 the input: the user who fills in a form. So, this is why I say that
 the input validation should be done around the View layer, while in
 the back (rt_auth function) I should assume with a precondition
 that the input is not evil anymore.

It's far too easy for the backend function to start being used somewhere
where the validation doesn't happen first, and then you're vulnerable
again.  The backend is a single point to fix, whereas validation might
need to happen across multiple views and interfaces.

The path of shoving the shell_exec() validation up into the view is
lined with awful websites which prohibit special characters in passwords.





--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


[rt-users] R: Custom authentication script fails with ExternalAuthPriority not defined, please check your configuration file

2013-01-02 Thread Scotto Alberto
Yep! That's something I was mumbling about.

Thanks to you, I've just given it a try.
It's not that easy peasy: REST returns 200 even if you are not authenticated. 
But you can deduce if you have been auth'd from the HTML page you get, 
searching for 'span id=not-logged-in ', for example.

What about the security point of view of the two methods of auth (my script vs 
REST)?
Assuming RT is reachable via https, can it be any worse than executing a script 
via ssh?


Da: Christian Loos [cl...@netsandbox.de]
Inviato: mercoledì 2 gennaio 2013 23.10
A: Scotto Alberto
Cc: rt-users@lists.bestpractical.com
Oggetto: Re: Custom authentication script fails with  ExternalAuthPriority not 
defined, please check your configuration file

Hi,

why not just call in you PHP app
https://your-rt-server-url/REST/1.0/
with user and pass as post parameter and check the first line of the
response for the status
* 200 Ok = successful login
* 401 Credentials required = not successful login


Chris


Am 20.12.2012 12:56, schrieb Scotto Alberto:
 Hi all,



 I’m writing a PHP application (a cloud self-service application that
 lets developers create testing environments and so on) for the company
 where I also installed RT. For the authentication part, I thought to
 authenticate users against RT, since the users of my PHP app are a
 subset of RT’s users.

 So, I’m down to writing a script (attached) that authenticates a user
 against RT, to be called from a PHP script.

 On RT I have RT-Authen-ExternalAuth that connects to LDAP.

 So in my perl script I’ve had to make two tries: first
 RT::Authen::ExternalAuth::DoAuth (for domain users); then, if it fails,
 $user-IsPassword($pass) (for local users).

 The problem is with RT::Authen::ExternalAuth::DoAuth; instead, the auth
 of local users with IsPassword always works.

 If I execute the script as root, it goes smooth.

 But for security reasons I want to execute it as another user (I created
 the Unix user “selfservice”, as well as the RT user “selfservice”).
 Executing the script as this Unix user, DoAuth fails with the following
 message:



 /ExternalAuthPriority not defined, please check your configuration file./



 What am I missing?



 Thank you very much!



 Regards



 Alberto Scotto






Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


[rt-users] R: R: R: Custom authentication script fails with ExternalAuthPriority not defined, please check your configuration file

2013-01-02 Thread Scotto Alberto



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

On 01/01/2013 10:43 AM, Scotto Alberto wrote:
 Don't know what is the best. I think using preconditions is a strong
 practice that gives you freedom and lets you avoid duplicate checks.
 Actually, the preconditions must be documented...

 So I think that I may go for documenting the precondition in the wiki
 page (also for simplicity).

 What do you think?

Relying on the input being validated before handed to the function is
asking for trouble as soon as the function starts being used in multiple
places, some of which may not validate the input.  The function should
be a black box, and you shouldn't need to know that it's going to pass
provided arguments to shell_exec().  Fix problems at the source, not at
some more distant location.  You'll end up playing whack a mole otherwise.

Thomas

__


Thanks for your contribution.

 Fix problems at the source
Exactly.
From my point of view, the source is who/what generates the input: the user 
who fills in a form. So, this is why I say that the input validation should be 
done around the View layer, while in the back (rt_auth function) I should 
assume with a precondition that the input is not evil anymore.



--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


[rt-users] R: R: Custom authentication script fails with ExternalAuthPriority not defined, please check your configuration file

2013-01-01 Thread Scotto Alberto
Hi Thomas.

First of all, Thank you for your feedback!

You are right.
Actually, in my mind, that function was supposed to have input validated by 
some other methods (around the View layer), as a precondition.

Now, I think it's a matter of design.
Whether
- to keep things strictly separate (only the high-level class charged with the 
input validation)
or
- to have validation in both layers (maybe with a strong validation in the 
high-level class and a minimum validation in the function auth_rt)

Don't know what is the best. I think using preconditions is a strong practice 
that gives you freedom and lets you avoid duplicate checks. Actually, the 
preconditions must be documented...

So I think that I may go for documenting the precondition in the wiki page 
(also for simplicity).

What do you think?

AS


PS: Happy New Year :)



Da: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Thomas Sibley 
[t...@bestpractical.com]
Inviato: lunedì 31 dicembre 2012 22.44
A: rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] R: Custom authentication script fails with  
ExternalAuthPriority not defined, please check your configuration file

On 12/27/2012 04:57 PM, Scotto Alberto wrote:
 I've just shared my script on rt wikia :)

 http://requesttracker.wikia.com/wiki/Rt-auth-user

 Any improvements are welcome.

 For example, I suspect there's a better way to do it (it =
 authenticating against external auths first, and then the local RT's
 DB). I'd expect to call only DoAuth, and then it should fall to
 IsPassword by itself, shouldn't it?

Your PHP example has a serious security flaw in it since you use
unescaped user input in the call to shell_exec().  Any username which
passes your check may be followed by a password which runs arbitrary
shell code on your server.




Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


[rt-users] R: Custom authentication script fails with ExternalAuthPriority not defined, please check your configuration file

2012-12-27 Thread Scotto Alberto
Oh, thank you, my saviour!

I was guessing it was about my lack of knowledge of the library (missing some 
parameters), so didn't think of the obvious..

Btw, I just had to give my 'selfservice' user read permissions for etc/ files


Happy new year to all of you,
and thank you all for your support and sharing!!
(bestpractical guys in particular; Kevin, in very particular!)

Cheers


Da: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Kevin Falcone 
[falc...@bestpractical.com]
Inviato: giovedì 27 dicembre 2012 20.18
A: rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] Custom authentication script fails with  
ExternalAuthPriority not defined, please check your configuration file

On Thu, Dec 20, 2012 at 11:56:44AM +, Scotto Alberto wrote:
But for security reasons I want to execute it as another user (I created 
 the Unix user
selfservice, as well as the RT user selfservice). Executing the script 
 as this Unix user,
DoAuth fails with the following message:

ExternalAuthPriority not defined, please check your configuration file.

Does the selfservice user have access to read your Configuration files
and all the RT libraries?

-kevin


Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


[rt-users] R: Custom authentication script fails with ExternalAuthPriority not defined, please check your configuration file

2012-12-27 Thread Scotto Alberto
I've just shared my script on rt wikia :)

http://requesttracker.wikia.com/wiki/Rt-auth-user

Any improvements are welcome.

For example, I suspect there's a better way to do it (it = authenticating 
against external auths first, and then the local RT's DB).
I'd expect to call only DoAuth, and then it should fall to IsPassword by 
itself, shouldn't it?



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


[rt-users] Custom authentication script fails with ExternalAuthPriority not defined, please check your configuration file

2012-12-20 Thread Scotto Alberto
Hi all,

I'm writing a PHP application (a cloud self-service application that lets 
developers create testing environments and so on) for the company where I also 
installed RT. For the authentication part, I thought to authenticate users 
against RT, since the users of my PHP app are a subset of RT's users.
So, I'm down to writing a script (attached) that authenticates a user against 
RT, to be called from a PHP script.
On RT I have RT-Authen-ExternalAuth that connects to LDAP.
So in my perl script I've had to make two tries: first 
RT::Authen::ExternalAuth::DoAuth (for domain users); then, if it fails, 
$user-IsPassword($pass) (for local users).
The problem is with RT::Authen::ExternalAuth::DoAuth; instead, the auth of 
local users with IsPassword always works.
If I execute the script as root, it goes smooth.
But for security reasons I want to execute it as another user (I created the 
Unix user selfservice, as well as the RT user selfservice). Executing the 
script as this Unix user, DoAuth fails with the following message:

ExternalAuthPriority not defined, please check your configuration file.

What am I missing?

Thank you very much!

Regards



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

[Blue Reply]




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

rt-auth-user
Description: rt-auth-user

We're hiring! http://bestpractical.com/jobs


[rt-users] Setting ticket properties with SetXXX instead of _Set, but SILENTLY

2012-10-14 Thread Scotto Alberto
As Thomas recently pointed out [1], _Set should never be used. Instead, you 
should use SetXXX public methods.
Ok, but what if I need to set some properties without recording a transaction 
for it, in order not to trigger scrips?

http://requesttracker.wikia.com/wiki/WriteCustomAction#How_to_be_silent
This is the reading that led me to use mostly _Set in my custom scrip actions.
Shoud it be corrected?
I think we should al least add a disclaimer like But beware that using _Set 
may cause strange behaviour.
The best would be to put a list of the properties that is safe to set with 
_Set, and those that are not. If any!
For example, I think that Priority, InitialPriority and FinalPriority are safe, 
as I think they're just a column in Tickets table. While Owner is not safe, as 
it's not just a column in Tickets table [1]

[1] http://www.gossamer-threads.com/lists/rt/users/112479#112479


Thanks



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

[Blue Reply]




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


[rt-users] R: Setting owner with _Set breaks queries (may be a bug)

2012-10-09 Thread Scotto Alberto
Ok, thanks for the explanations.

I tried executing an UPDATE statement, but nothing has changed. The TicketSQL 
query Owner.RealName = 'Nobody in particular'  still returns more tickets 
than it should.

Here is the UPDATE, which sets GroupMembers.MemberId with the value in 
Tickets.Owner:
UPDATE Tickets t join Groups g on t.id=g.Instance join GroupMembers m on 
m.GroupId=g.id
SET m.MemberId=t.Owner
WHERE
g.Domain = 'RT::Ticket-Role' and
g.Type = 'Owner' and
t.Owner  m.MemberId

Now the query that looks for tickets where GroupMembers.MemberId differs from 
Tickets.Owner
returns 0 rows:
select  *  from Tickets t join Groups g on t.id=g.Instance join GroupMembers m 
on m.GroupId=g.id
WHERE g.Domain = 'RT::Ticket-Role' and g.Type = 'Owner' and t.Owner  
m.MemberId;

What am I missing?
Thank you again


Da: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Thomas Sibley 
[t...@bestpractical.com]
Inviato: martedì 9 ottobre 2012 19.14
A: rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] Setting owner with _Set breaks queries (may be a bug)



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

On 10/05/2012 08:15 AM, Scotto Alberto wrote:
 Very interesting, thank you! Now I understand the relationships. So I
 think I should correct all the _Set I've used all around in my custom
 scrips :(

Yes, rarely is _Set the right answer.

 To verify if it finds the errors caused by _Set I searched in the
 ouput for 2985, which is the number of a ticket affected by the
 issue. I also searched for 12626, the ID of the owner group
 associated with that ticket. But none of them are there.

rt-validator does not validate or fix this problem.  There's a comment
in the code:

# XXX: check that owner is only member of owner role group

 PS: (OT) if at every moment the Owner is one and only one, I wonder
 why you defined a group for role Owner. Maybe in order to have a
 history of past owners? Or for some code consistency?

All access control in RT is based on groups (even individual users have
equivalence groups containing only them).  The reason Owner is a column
on the Tickets table is for historical reasons, performance, and
convenience.


Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs





--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


[rt-users] R: R: Setting owner with _Set breaks queries (may be a bug)

2012-10-09 Thread Scotto Alberto
It worked tah!
Powerful thank you! Great tool rt-validator!

Just hope I haven't screwed up all the rest :)


Da: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Thomas Sibley 
[t...@bestpractical.com]
Inviato: martedì 9 ottobre 2012 23.29
A: rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] R: Setting owner with _Set breaks queries (may be a bug)



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

On 10/09/2012 11:14 AM, Scotto Alberto wrote:
 What am I missing?

The CachedGroupMembers table, I expect.  rt-validator should be able to
fix that, I believe.



Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs





--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


Re: [rt-users] Setting owner with _Set breaks queries (may be a bug)

2012-10-05 Thread Scotto Alberto
Very interesting, thank you!
Now I understand the relationships.
So I think I should correct all the _Set I've used all around in my custom 
scrips :(

Talking about correcting the old tickets processed with _Set, I think 
rt-validator doesn't help, can you please confirm?
Here is the output of rt-validator --check: http://pastebin.com/1PTL8mY8
To verify if it finds the errors caused by _Set I searched in the ouput for 
2985, which is the number of a ticket affected by the issue. I also searched 
for 12626, the ID of the owner group associated with that ticket. But none of 
them are there.

Thanks


PS: (OT) if at every moment the Owner is one and only one, I wonder why you 
defined a group for role Owner. Maybe in order to have a history of past 
owners? Or for some code consistency?




Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Thomas Sibley
Sent: giovedì 4 ottobre 2012 18:50
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Setting owner with _Set breaks queries (may be a bug)

On 10/04/2012 04:05 AM, Scotto Alberto wrote:
 I think I found a bug.

Not a bug in RT, only your scrip. :)

 Looks like _Set doesn’t update correctly some field in some table in
 the DB. But I have no idea of what field and what table! I had a quick
 look at the DB, and it seems that the relation ticket-owner is based
 on an user ID, not a string (the real name).

Using _Set to change the Owner is incorrect as it only updates the Owner column 
in the Tickets table.  It doesn't also update the Owner role group for the 
ticket.  SetOwner does both.

In general you shouldn't be calling private methods (starting with an
underscore) from code you write, for reasons just like this.

rt-validator may be able to fix your existing tickets, but I haven't checked so 
I'm not certain.

http://bestpractical.com/rt/docs/latest/rt-validator.html


Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs





--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


[rt-users] Setting owner with _Set breaks queries (may be a bug)

2012-10-04 Thread Scotto Alberto
Hi all,
I think I found a bug.
I have a scrip called On closure Auto set owner, which sets the owner while 
closing the ticket in case nobody has never taken it, so that I don't get 
resolved tickets assigned to Nobody in particular.
Everything seemed ok until today a colleague of mine noticed something weird 
with a chart that acts like a hall of fame, showing the top Owners. This chart 
is very simple: it retrieves all the tickets and it is grouped by 
Owner.RealName.
The weird thing is not the chart itself, but the fact that the following two 
queries should return the same tickets but they don't:

-  Owner.RealName = 'Nobody in particular' returns 706 tickets

-  Owner = 'Nobody in particular' returns 369 tickets
The results of the former are not correct: it includes also the tickets for 
which the owner was set by my scrip, though the column Owner is correct 
(filled with John Doe, not Nobody in particular).

Here are the relevant lines of the code of my scrip:

# get actor ID
my $Actor = $self-TransactionObj-Creator;
my $tkt = $self-TicketObj;
# try to change owner
my ($status, $msg) = $tkt-_Set(Field = 'Owner', Value = $Actor, 
RecordTransaction = 0);

I solved the problem using SetOwner instead of _Set, like this:

my ($status, $msg) = $tkt-SetOwner($Actor);

With the new code, the tickets whose owner is set by my scrip don't get caught 
by the query Owner.RealName = 'Nobody in particular'.

Looks like _Set doesn't update correctly some field in some table in the DB. 
But I have no idea of what field and what table! I had a quick look at the DB, 
and it seems that the relation ticket-owner is based on an user ID, not a 
string (the real name).

Finally, a weird thing with the chart: on the right side, it displays all the 
owners and the number of tickets associated. For Nobody in particular, the 
number is 369 (correct); but if I click on this number it generates the query 
Owner.RealName = 'Nobody in particular' saying Found 706 tickets.

The questions are:
Should I file a bug?
How can I convert the tickets that were processed with the old code?

Hope everything is clear

Thank you very much!



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

[Blue Reply]




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


Re: [rt-users] Setting owner with _Set breaks queries (may be a bug)

2012-10-04 Thread Scotto Alberto
Joe,
Thank for you your quick answer!

I’ll take ticket #2985 as an example, which is one of those affected by the 
issue.

The scrip correctly happens in the transaction #38624, “Status changed from 
'new' to 'resolved'”, as the (custom) scrip condition is (taken from the DB):

| 17 | On closure | If the status is set to inactive
 | StatusChange| old: 
initial, active; new: inactive | Status   | 
  1 | 2012-05-30 15:54:19 | 1 | 2012-05-30 15:54:19 |

Here is some output from rt.log:

[Mon Sep 10 13:24:00 2012] [debug]: About to think about scrips for transaction 
#38624 (/opt/rt4/sbin/../lib/RT/Transaction.pm:173)
[Mon Sep 10 13:24:00 2012] [debug]: About to prepare scrips for transaction 
#38624 (/opt/rt4/sbin/../lib/RT/Transaction.pm:177)
[Mon Sep 10 13:24:00 2012] [debug]: Found 15 scrips for TransactionCreate stage 
with applicable type(s) Status for txn #38624 on ticket #2985 
(/opt/rt4/sbin/../lib/RT/Scrips.pm:367)
[Mon Sep 10 13:24:00 2012] [debug]: Skipping Scrip #19 because it isn't 
applicable (/opt/rt4/sbin/../lib/RT/Scrips.pm:229)
[Mon Sep 10 13:24:00 2012] [debug]: Skipping Scrip #35 because it isn't 
applicable (/opt/rt4/sbin/../lib/RT/Scrips.pm:229)
[Mon Sep 10 13:24:00 2012] [debug]: Skipping Scrip #18 because it isn't 
applicable (/opt/rt4/sbin/../lib/RT/Scrips.pm:229)
[Mon Sep 10 13:24:00 2012] [debug]: Skipping Scrip #12 because it isn't 
applicable (/opt/rt4/sbin/../lib/RT/Scrips.pm:229)
[Mon Sep 10 13:24:00 2012] [debug]: Skipping Scrip #2 because it isn't 
applicable (/opt/rt4/sbin/../lib/RT/Scrips.pm:229)
[Mon Sep 10 13:24:00 2012] [debug]: Skipping Scrip #21 because it isn't 
applicable (/opt/rt4/sbin/../lib/RT/Scrips.pm:229)
[Mon Sep 10 13:24:00 2012] [debug]: Skipping Scrip #27 because it isn't 
applicable (/opt/rt4/sbin/../lib/RT/Scrips.pm:229)
[Mon Sep 10 13:24:00 2012] [debug]: Skipping Scrip #23 because it isn't 
applicable (/opt/rt4/sbin/../lib/RT/Scrips.pm:229)
[Mon Sep 10 13:24:00 2012] [debug]: Skipping Scrip #29 because it isn't 
applicable (/opt/rt4/sbin/../lib/RT/Scrips.pm:229)
[Mon Sep 10 13:24:00 2012] [debug]: Skipping Scrip #37 because it isn't 
applicable (/opt/rt4/sbin/../lib/RT/Scrips.pm:229)
[Mon Sep 10 13:24:00 2012] [debug]: Skipping Scrip #38 because it isn't 
applicable (/opt/rt4/sbin/../lib/RT/Scrips.pm:229)
[Mon Sep 10 13:24:00 2012] [debug]: About to commit scrips for transaction 
#38624 (/opt/rt4/sbin/../lib/RT/Transaction.pm:197)
[Mon Sep 10 13:24:00 2012] [debug]: Committing scrip #34 on txn #38624 of 
ticket #2985 (/opt/rt4/sbin/../lib/RT/Scrips.pm:183)
[Mon Sep 10 13:24:00 2012] [info]: Attempting to auto assign ticket #2985 to 
user #3444 ((eval 3201):12)
[Mon Sep 10 13:24:00 2012] [debug]: Committing scrip #10 on txn #38624 of 
ticket #2985 (/opt/rt4/sbin/../lib/RT/Scrips.pm:183)
[Mon Sep 10 13:24:00 2012] [debug]: Calling SetRecipientDigests for transaction 
RT::Transaction=HASH(0xe6582b0), id 38624 
(/opt/rt4/sbin/../lib/RT/Action/SendEmail.pm:6

Attached you can find two queries I’ve just executed in my DB. It shows that 
the owner is correctly set as the id of the user John Doe.


Ø  And the chart looks for the resolved transaction to get owner at the time of 
resolution?
I don’t think it’s a matter of transactions, as I think the chart queries 
tickets, not transactions.








Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

[Blue Reply]

From: Joe Harris [mailto:drey...@gmail.com]
Sent: giovedì 4 ottobre 2012 13:37
To: Scotto Alberto
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Setting owner with _Set breaks queries (may be a bug)

This is a shot in the dark and I may be way off, but is there a chance your 
scrip to set the owner runs in a transaction that happens after the transaction 
that resolves the ticket?

And the chart looks for the resolved transaction to get owner at the time of 
resolution?

Just a thought.
Sent from my mobile device.

On Oct 4, 2012, at 7:05 AM, Scotto Alberto 
al.sco...@reply.itmailto:al.sco...@reply.it wrote:
Hi all,
I think I found a bug.
I have a scrip called On closure Auto set owner, which sets the owner while 
closing the ticket in case nobody has never taken it, so that I don't get 
resolved tickets assigned to Nobody in particular.
Everything seemed ok until today a colleague of mine noticed something weird 
with a chart that acts like a hall of fame, showing the top Owners. This chart 
is very simple: it retrieves all the tickets and it is grouped by 
Owner.RealName.
The weird thing is not the chart itself, but the fact that the following two 
queries should return the same tickets but they don’t:

-  Owner.RealName = 'Nobody in particular' returns 706 tickets

-  Owner = 'Nobody in particular' returns 369 tickets
The results of the former are not correct

Re: [rt-users] share dashboard with a group

2012-10-02 Thread Scotto Alberto
You have to grant rights accordingly.
See http://requesttracker.wikia.com/wiki/ManualDashboards
I’d suggest to go to Tools, configuration, global, group rights, and grant the 
rights for viewing group dashboards to test_grp

Regards







Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

[Blue Reply]

From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Asanka Gunasekera
Sent: martedì 2 ottobre 2012 12:26
To: rt-users@lists.bestpractical.com
Subject: [rt-users] share dashboard with a group

Hi, I have created a dash board (test_dash) and I have a group called test_grp. 
Now I want to share this dash with my group. How can I going about doing this

Thanks and Regards



--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


[rt-users] R: 2. try ;-) Limit user in a perl script

2012-09-19 Thread Scotto Alberto
Well, that's normal: you are scanning the whole tickets list again and again, 
for every user.
You should invert the nested loops such that you scan the tickets only once.

Something like this (kind of pseudo-code):

my $tickets = RT::Tickets-new($RT::SystemUser);
my @users_with_ticket;
# let's collect all the users who relate to some ticket
while (my $t = tickets-next) {
   push @users_with_ticket, $t-Requestor;
   push @users_with_ticket, $t-Owner;
   # push all the other actors
}
# now, let's take the complement of the set users_with_ticket
my $users = RT::Users-new($RT::SystemUser)
my @users_without_ticket;
while(my $u = $users-next) {
   if ($u IS NOT IN $users_with_ticket) push @users_without_ticket, $u;
}

The last loop (just a draft) may still be critical, but considering that, in 
your case study, the bigger number is given by the tickets, I think you're 
quite safe.

Regards

AS


Da: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Björn Schulz 
[bjoern.sch...@desy.de]
Inviato: mercoledì 19 settembre 2012 15.48
A: rt-users@lists.bestpractical.com
Oggetto: [rt-users]  2. try ;-) Limit user in a perl script

Hi!

I try to ask again, because on my producton system it takes a very long
time to limit users (7 Minutes !!! per user :-(( ).

I try to search for users with no connections to any ticket and no
connection to any attachments to delete them later.

I can't use rt-shredder directly ;-)

I try this:

...
my $user  = RT::User-new($RT::SystemUser);
my $users = RT::Users-new($RT::SystemUser);
my $tix   = RT::Tickets-new($RT::SystemUser);


$users-FindAllRows ;

while (my $uid = $users-next ) {
 my $tickets   = RT::Tickets-new($RT::SystemUser);
 $user-Load($uid);
 $tickets-FromSQL('
Type = ticket AND
Watcher ='.$user-EmailAddress.'');

  Delete_User if ! $tickets-Count();
...



But it takes much time (about 7 minutes per user )
in my system for every user.

~500.000 tickets
~ 61.100 users

Is there a better method to limit the user with no tickets and no
attachments or what am I doing wrong?

Cheers,
  Björn


Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs




Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


[rt-users] R: Wild Card Question

2012-09-19 Thread Scotto Alberto

https://www.google.it/search?q=site%3Alists.bestpractical.com+wildcard





Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

[Blue Reply]



Da: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di William Culp 
[culp1...@gmail.com]
Inviato: mercoledì 19 settembre 2012 19.44
A: rt-us...@bestpractical.com
Oggetto: [rt-users] Wild Card Question

Hello

Is there a way that I can use a wild card in one of our searches?  I have 
multiple queues that all start with the same character.  I would like to search 
all of those queues without having to modify the search every time I add a new 
queue.

Thanks

Bill

RT 4.5.5



--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


Re: [rt-users] rt4 log rotation

2012-09-13 Thread Scotto Alberto
I did it by configuring /etc/logrotate.conf

See man logrotate





Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

[Blue]

From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Pedro Albuquerque
Sent: giovedì 13 settembre 2012 12:22
To: rt-users@lists.bestpractical.com
Subject: [rt-users] rt4 log rotation

Hi guys,

does anyone of you configured log rotation for rt4 logs?

thanks,
Pedro.



--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


Re: [rt-users] [SLA Extension] Can I 'parked' stalled tickets?

2012-08-24 Thread Scotto Alberto
Have a look at my customization for parking stalled tickets (actually it works 
for SLA 0.05)

http://www.gossamer-threads.com/lists/rt/users/110572

If you make any improvements, please share them :)





Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Dave Fitches
Sent: venerdì 24 agosto 2012 06:40
To: rt-users@lists.bestpractical.com
Subject: [rt-users] [SLA Extension] Can I 'parked' stalled tickets?

Hi all,

I've been working with RT 4.05 and have added the SLA Extension [v.0.06] to it.

We're using some simple SLA rules - no respond or keepinloop rules, just 
resolve rules.  Generally, all tickets should be resolved within x Days from 
ticket creation.

Eg;

'Normal' = {
Resolve = { BusinessMinutes = 60*8*5, 
IgnoreOnStatuses = ['stalled']  }, # Within 5 Working Days
},

We're using Business:Hours to make sure weekend and public holidays aren't 
counted.

Jobs start at Priority 0 and via an hourly  LinearEscalate Cron job, escalate 
to Priority 100 the closer they get to the due date. So a job with a 5 working 
day SLA will be at Priority 40 after 2 business days.


Now - as a basic setup, it's all working nicely. (And I'd like to say - I love 
the program!)


There's just ONE thing not working the way we'd like and I suspect I've missed 
something, so I'd appreciate a second opinion.


You'll notice we've got IgnoreOnStatuses = ['stalled'] in there. If we make 
a job and stall it, the priority does NOT advance. All good so far.

However when the job is changed from stalled back to open, it doesn't punch the 
Due Date out according to the time it was stalled. So - a job is due 5 days 
after it's created. If we stall the job after 4 hours, the priority will freeze 
at 10. If we change the job back to open 2 days later, the due date remains 
unchanged and the job will still be due in another 2.5 days. Next time the 
LinearEscalate cron job runs, the Priority jumps right up to 50.

What we WANT it to do, is - when we un-stall the job 2 days later, we want RT 
to automatically extend the Due Date by the same amount of time it was stalled 
- in this case, 2 days.

Any thoughts? What've I missed?

--
= Dave Fitches =


.,--__|\.. David Fitches - Security Software Admin
/   |. University of Melbourne - Access Control
\_,--__/.. * Ph/Mob : +61-3-8344-9232 / +61-411-811-525
..v... * E-mail : dfitc...@unimelb.edu.au
.. University of Melbourne, Victoria, Australia
___



--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

Re: [rt-users] [SLA Extension] Can I 'parked' stalled tickets?

2012-08-24 Thread Scotto Alberto
Sorry, the version of SLA extension shouldn't matter.





Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

From: Scotto Alberto
Sent: venerdì 24 agosto 2012 17:01
To: Dave Fitches; rt-users@lists.bestpractical.com
Subject: RE: [SLA Extension] Can I 'parked' stalled tickets?

Have a look at my customization for parking stalled tickets (actually it works 
for SLA 0.05)

http://www.gossamer-threads.com/lists/rt/users/110572

If you make any improvements, please share them :)




Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

From: 
rt-users-boun...@lists.bestpractical.commailto:rt-users-boun...@lists.bestpractical.com
 
[mailto:rt-users-boun...@lists.bestpractical.com]mailto:[mailto:rt-users-boun...@lists.bestpractical.com]
 On Behalf Of Dave Fitches
Sent: venerdì 24 agosto 2012 06:40
To: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com
Subject: [rt-users] [SLA Extension] Can I 'parked' stalled tickets?

Hi all,

I've been working with RT 4.05 and have added the SLA Extension [v.0.06] to it.

We're using some simple SLA rules - no respond or keepinloop rules, just 
resolve rules.  Generally, all tickets should be resolved within x Days from 
ticket creation.

Eg;

'Normal' = {
Resolve = { BusinessMinutes = 60*8*5, 
IgnoreOnStatuses = ['stalled']  }, # Within 5 Working Days
},

We're using Business:Hours to make sure weekend and public holidays aren't 
counted.

Jobs start at Priority 0 and via an hourly  LinearEscalate Cron job, escalate 
to Priority 100 the closer they get to the due date. So a job with a 5 working 
day SLA will be at Priority 40 after 2 business days.


Now - as a basic setup, it's all working nicely. (And I'd like to say - I love 
the program!)


There's just ONE thing not working the way we'd like and I suspect I've missed 
something, so I'd appreciate a second opinion.


You'll notice we've got IgnoreOnStatuses = ['stalled'] in there. If we make 
a job and stall it, the priority does NOT advance. All good so far.

However when the job is changed from stalled back to open, it doesn't punch the 
Due Date out according to the time it was stalled. So - a job is due 5 days 
after it's created. If we stall the job after 4 hours, the priority will freeze 
at 10. If we change the job back to open 2 days later, the due date remains 
unchanged and the job will still be due in another 2.5 days. Next time the 
LinearEscalate cron job runs, the Priority jumps right up to 50.

What we WANT it to do, is - when we un-stall the job 2 days later, we want RT 
to automatically extend the Due Date by the same amount of time it was stalled 
- in this case, 2 days.

Any thoughts? What've I missed?

--
= Dave Fitches =


.,--__|\.. David Fitches - Security Software Admin
/   |. University of Melbourne - Access Control
\_,--__/.. * Ph/Mob : +61-3-8344-9232 / +61-411-811-525
..v... * E-mail : dfitc...@unimelb.edu.au
.. University of Melbourne, Victoria, Australia
___



--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: image001.pnginline: blue.png

[rt-users] R: Use Query builder to find tickets which were closed after the became over due

2012-08-17 Thread Scotto Alberto
Hi

I'm afraid you can't.

I've had the same problem, and I solved with some creativity, involving 
escalation.
I decided that FinalPriority = 89 and, once LinearEscalate has brought one's 
ticket Priority to 89, then a rt-crontool job increments Priority by some value.
So, in my searches, I can distinguish overdue/not overdue tickets by Priority, 
in this way:
Priority  89 = overdue
Priority = 89 = not overdue

Hope this helps.

Anyway I'd like to hear other (better) solutions to this problem.

Regards




Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it



Da: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Shrivallabh Deshmukh 
[shrivallabh.deshm...@sungard.com]
Inviato: venerdì 17 agosto 2012 12.52
A: rt-users@lists.bestpractical.com
Oggetto: [rt-users] Use Query builder to find tickets which were closed after 
the became over due

HI.

Can I compare 2 fields using query builder?

For example, can I do a query which says display all fields which are closed 
after their due date?

Regards,


Shrivallabh



--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

[rt-users] R: queue disabled but still getting tickets

2012-08-08 Thread Scotto Alberto
I think you should also set the permissions at the queue level accordingly.





Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it



Da: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Aaron Zuercher 
[aaron.techge...@gmail.com]
Inviato: mercoledì 8 agosto 2012 16.56
A: RT Users
Oggetto: [rt-users] queue disabled but still getting tickets

I have disabled one of my queues to prevent new ticket submission but new 
tickets are still showing up.  How to I stop this?  I don't want to remove the 
queue because I want to reopen it in a month.

I disabled it by going to TOOLS  CONFIG  QUEUES and unchecking enabled box.

Thanks,
Aaron



--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

Re: [rt-users] How to efficiently filter tickets with LimitXXX methods of RT::Tickets?

2012-07-26 Thread Scotto Alberto
I think I got it.

RT::Tickets exposes DeleteRestriction, which


Takes the row Id of a restriction (From DescribeRestrictions' output, for 
example.

Removes that restriction from the session's limits






Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

From: Scotto Alberto
Sent: sabato 21 luglio 2012 20:12
To: rt-users@lists.bestpractical.com
Subject: How to efficiently filter tickets with LimitXXX methods of RT::Tickets?

Hi all,

I'm customizing the script 
http://requesttracker.wikia.com/wiki/RtUnifiedreminder to send a daily report 
about SLA, with the overdue tickets.
I have a series of nested loops, the main is for each QueueAdminCC send the 
report to him/her.
In order to find the overdue tickets that are up to him/her, I'm using 
RT::Tickets methods: LimitStatus, LimitDue, LimitQueue.

Here is the question.
Is there a way to cache some parts of filtering so that I don't have to start 
filtering from the ground but use the results previously computed?
If APIs don't give anything specific, I think the only way is cloning the 
object RT::Tickets after applying the general filters?
In the latter case, would you please give me some hints? Sorry for the dumb 
question, I'm quite n00b with Perl.

Thank you all!



Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: image001.pnginline: blue.png

[rt-users] R: Marking a Ticket as Read

2012-07-25 Thread Scotto Alberto
Hi Tim,

there's an option you have to enable in RT_SiteConfig


=item C$ShowUnreadMessageNotifications
If set to 1, RT will prompt users when there are new,
unread messages on tickets they are viewing.
=cut

Set($ShowUnreadMessageNotifications, 1);




Inizio: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Tim Gustafson 
[t...@soe.ucsc.edu]
Inviato: mercoledì 25 luglio 2012 17.21
Fine: rt-users@lists.bestpractical.com
Oggetto: [rt-users] Marking a Ticket as Read

I just upgraded from 3.8 to 4.0, and I notice something missing: when
a ticket had new comments on it before, there used to be a link at the
top of the page that said show new comments, followed by another one
that said show new comments and mark them all as read, or something
to that effect.  I don't see that anymore, and now I have a bunch of
tickets with new comments and no way to mark them as read.

Where did this functionality move to?  I rely on it to know which of
my tickets have had activity since the last time I looked at it.

Thanks!

--

Tim Gustafson
t...@soe.ucsc.edu
831-459-5354
Baskin Engineering, Room 313A


Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


Re: [rt-users] Limit Owner dropdown to only privileged users

2012-07-24 Thread Scotto Alberto
Take a look at the rights you assigned to the group Everyone
You may have granted the OwnTicket right to Everyone, either at a global level 
(http://fpt-service.fpt.local/Admin/Global/GroupRights.html) or at a queue 
level (http://fpt-service.fpt.local/Admin/Queues/GroupRights.html?id=XX)

This morning I bumped into the same problem. But in my case, this problem 
affected only one queue: OwnTicket was granted to Everyone at queue level.

Hope this helps :)



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it

-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Alex Dyas
Sent: martedì 24 luglio 2012 15:58
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Limit Owner dropdown to only privileged users


Hello,

RT Version - 4.0.2

The dropdown we see for selecting the owner of a ticket is currently populated 
with all the users of the system, including unprivileged users who have been 
auto created by emailing the system.

How do I limit the dropdown to only include privileged users?

Alternatively, how do I prevent auto creation of unprivileged users? I don't 
really see the point of users being created automatically when people email in.

Thanks,

Alex
--
View this message in context: 
http://old.nabble.com/Limit-Owner-dropdown-to-only-privileged-users-tp34203861p34203861.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


[rt-users] How to efficiently filter tickets with LimitXXX methods of RT::Tickets?

2012-07-21 Thread Scotto Alberto
Hi all,

I'm customizing the script 
http://requesttracker.wikia.com/wiki/RtUnifiedreminder to send a daily report 
about SLA, with the overdue tickets.
I have a series of nested loops, the main is for each QueueAdminCC send the 
report to him/her.
In order to find the overdue tickets that are up to him/her, I'm using 
RT::Tickets methods: LimitStatus, LimitDue, LimitQueue.

Here is the question.
Is there a way to “cache” some parts of filtering so that I don’t have to start 
filtering from the ground but use the results previously computed?
If APIs don't give anything specific, I think the only way is cloning the 
object RT::Tickets after applying the general filters?
In the latter case, would you please give me some hints? Sorry for the dumb 
question, I'm quite n00b with Perl.

Thank you all!




Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

[rt-users] R: Backing up RT's configuration files?

2012-07-12 Thread Scotto Alberto
Hi Kevin,

I think it's enough to back up:
- etc/ containing RT's config files
- local/ containing all the extensions you added and your own customizations

Regards


Inizio: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Kevin Elliott 
[kevin_elli...@ci.juneau.ak.us]
Inviato: giovedì 12 luglio 2012 19.52
Fine: rt-users@lists.bestpractical.com
Oggetto: [rt-users] Backing up RT's configuration files?

Hello all.

I have temporary custodianship over our RT server and would like to implement 
some sort of simple script backup system.

I'm planning on just dumping a copy of the database onto our backup server but 
what other files should I tar and move off the host? I am not very familiar 
with the underpinnings of RT so it's difficult for me to decide what to backup.

What files/directories should I backup so that I can quickly recover the RT 
server and our ticket content in the event of Something Bad(TM)?


Thanks.

--
Kevin Elliott

Network Specialist
City and Borough of Juneau, MIS
(907) 586 - 0905



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


[rt-users] R: Backing up RT's configuration files?

2012-07-12 Thread Scotto Alberto
A small add: I assumed that all your customizations were made following 
official guidelines, i.e. putting everything under local/ path. If you are 
unsure, include lib/ directory in your backup.

Moreover, here are two semi-official backup scripts:

http://requesttracker.wikia.com/wiki/BackupRTDB
http://requesttracker.wikia.com/wiki/BackupRT



Inizio: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Scotto Alberto 
[al.sco...@reply.it]
Inviato: giovedì 12 luglio 2012 20.13
Fine: Kevin Elliott; rt-users@lists.bestpractical.com
Oggetto: [rt-users] R: Backing up RT's configuration files?

Hi Kevin,

I think it's enough to back up:
- etc/ containing RT's config files
- local/ containing all the extensions you added and your own customizations

Regards


Inizio: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Kevin Elliott 
[kevin_elli...@ci.juneau.ak.us]
Inviato: giovedì 12 luglio 2012 19.52
Fine: rt-users@lists.bestpractical.com
Oggetto: [rt-users] Backing up RT's configuration files?

Hello all.

I have temporary custodianship over our RT server and would like to implement 
some sort of simple script backup system.

I'm planning on just dumping a copy of the database onto our backup server but 
what other files should I tar and move off the host? I am not very familiar 
with the underpinnings of RT so it's difficult for me to decide what to backup.

What files/directories should I backup so that I can quickly recover the RT 
server and our ticket content in the event of Something Bad(TM)?


Thanks.

--
Kevin Elliott

Network Specialist
City and Borough of Juneau, MIS
(907) 586 - 0905



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


[rt-users] R: Time Calculation in Search Queries

2012-07-08 Thread Scotto Alberto
LastUpdated = '12 hours ago'

http://requesttracker.wikia.com/wiki/TicketSQL#Date_Syntax


Regards





Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it



Inizio: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Payam Poursaied 
[m...@payam124.com]
Inviato: domenica 8 luglio 2012 16.03
Fine: rt-users@lists.bestpractical.com
Oggetto: [rt-users] Time Calculation in Search Queries

Hi all
One of my colleagues intended to get daily updates on tickets which has been 
not updated for past 12 hours.
I wrote a perl script and used REST interface. Then parse the output and based 
on the results, email him.

The web URL is something like below which I substitute date with current 
date-time minus 12 hours

http://ticket/rt/REST/1.0/search/ticket?query=Queue = 'NOC-Voice' AND (  Status 
= 'new' OR Status = 'open’ OR Status = 'stalled' ) AND LastUpdated  '2012-6-8 
16:51'

another way came to my mind but I could not completely implement it due to time 
calculation. In the second way, I intended to create a search and put it into 
dashboard and subscribe to that dashboard to have it each day in the mailbox. 
The problem which I could  not figure it out, is how to do date calculation in 
search query, i.e. something like “LastUpdated = NOW() – 12 hours”

is there any mechanism like this at all?



--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

[rt-users] R: Autocomplete feature for unprivileged users (AllowUserAutocompleteForUnprivileged?)

2012-06-12 Thread Scotto Alberto
I DID IT

Set($SelfServiceRegex, qr!^(?:/+(SelfService|Helpers/Autocomplete)/)!x );

I'm not a perl regex expert at all, but it works! Or so it seems!
I'm afraid it's too easy to be correct, so, please, tell me if it's fine.

Thank you so much!!!



Da: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Thomas Sibley 
[t...@bestpractical.com]
Inviato: martedì 29 maggio 2012 14.57
A: rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] R: Autocomplete feature for unprivileged users  
(AllowUserAutocompleteForUnprivileged?)

On 05/29/2012 08:50 AM, SCOTTO Alberto (Consultant) (FIAT POWERTRAIN
TECHNOLOGIES) wrote:
 Thank you very much for the link!
 It's a feature very useful for end users, so when I have time, I'll try to 
 figure out how to solve the problem (I see a solution already exists, I'll 
 see if it works on RT4).

FWIW, the autocomplete feature only exists in RT 4.  I believe the
correct workaround is to add /Helpers/Autocomplete/Users and
/Helpers/Autocomplete/Owners to the $SelfServiceRegex config option.

We're working on a fix which also refactors and tidies up the
autocomplete endpoints while we're at it.

Thomas




Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

[rt-users] R: Extension to allow queue change on creating child ticket

2012-06-12 Thread Scotto Alberto
If I understand well, then you didn't search very well: this extension is 
listed in bestpractical's website!
http://bestpractical.com/rt/extensions.html

http://search.cpan.org/dist/RT-Extension-SpawnLinkedTicketInQueue/lib/RT/Extension/SpawnLinkedTicketInQueue.pm

BTW, there is something I don't quite understand about this extension, and I'm 
gonna ask.
The fact is that the child ticket created by the extension does not contain any 
text of the original request, which doesn't seem very nice to me..
Maybe the idea is to avoid duplicating something memory-expensive as the 
content of a request. Nevertheless it takes much more for the AdminCC of the 
new queue to read the request, as he/she has to do more clicks (links, 
parent).
Anyone who noticed this behaviour and improved it?
I haven't gone deep on this yet, as I'm on configuring/customizing SLA 
extension right now

Thanks



Inizio: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di Mike Johnson 
[mike.john...@nosm.ca]
Inviato: martedì 12 giugno 2012 22.38
Fine: rt-users@lists.bestpractical.com
Oggetto: [rt-users] Extension to allow queue change on creating child ticket

Greetings all,

I searched for an answer to this, but couldn't come up with anything relevant.

Is there an extension out there, or has someone customized their rt to allow 
you to pick the queue a child ticket gets created in? So we don't have to do a 
multi-step process to have children tickets on a parent that are in a different 
queue?

Would there be some sort of scrip I could make to do this if there isn't an 
extension or customization?

Any insight on this would be appreciated.

Thanks!
Mike.

--
Mike Johnson
Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON   P7B 5E1
Phone: (807) 766-7331
Email: mike.john...@nosm.camailto:mike.john...@nosm.ca



--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


[rt-users] R: [SLA] Custom (and very imperfect) solution for parking stalled tickets

2012-06-09 Thread Scotto Alberto
Yep, I think it would be cool.
But you should also help me dealing with assumption #2: I'd like to disallow 
the modification of the tickets' attributes involved. Maybe not to everyone; 
maybe we could work with ACEs, splitting the ModifyTicket right in ModifyTicket 
and ModifyDates, or something like that.
What do you think?





Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it



Inizio: Ruslan Zakirov [ruslan.zaki...@gmail.com]
Inviato: sabato 9 giugno 2012 13.21
Fine: Scotto Alberto
Cc: rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] [SLA] Custom (and very imperfect) solution for parking 
stalled tickets


I'm glad if it works for you. Would like to see functionality in extension. 
Your solution needs refactoring to be merged. If you like I can guide you and 
help put it into shape for merge.

Ruslan from phone.

08.06.2012 2:24 пользователь Scotto Alberto 
al.sco...@reply.itmailto:al.sco...@reply.it написал:
Working with the SLA Extension, I came across the problem of stalled tickets: 
by default, there is no way to stop the timer for the due date when a ticket 
becomes stalled, as stated by the author in
http://www.gossamer-threads.com/lists/rt/users/105845#105845

So I've just implemented a small customization (very imperfect indeed) and I 
want to share it with all of you. Feel free to contribute, and please share 
your improvements.

First of all, a few assumptions (aka limitations):
- in $RT::ServiceBusinessHours we defined only 'Default' ServiceBusinessHours
- users will not modify the date fields we set, otherwise everything would 
screw up

The idea is to move the due date forward as soon as the ticket exits the 
stalled status. To compute the new due date we need to know when the tickets 
became stalled. So, we first have to save somewhere the time when it became 
stalled: we temporarly save it in the Resolved attribute (very dirty, I 
know..!), which shouldn't be used while stalled.

This solution includes two actions, two conditions, and two scrips which put 
everything together.

Conditions, which you can easily build thanks to sbin/rt-setup-database and the 
ExecModule StatusChange:
- on stalled
- on un-stall

Actions (the code is below):
- Set resolved temporarly
- Update due date on un-stall

Scrips:
- On stalled Set resolved temporarly
- On un-stall Update due date


I think the most important improvement would be to avoid the use of the 
Resolved attribute as temporary. Instead, it would be better to define a new 
private attribute in Ticket.pm; consequently, a new column in the DB, etc.

Of course, I will appreciate any suggestions, comments, etc.

Thanks

AS


 Action1. Set resolved temporarly =
my $tkt = $self-TicketObj;
my $id = $tkt-Id;
my $stalled_date = RT::Date-new( $RT::SystemUser );
$stalled_date-SetToNow;
my ($status, $msg) = $tkt-_Set(
   Field = 'Resolved',
   Value = $stalled_date-ISO,
   RecordTransaction = 0
);
unless ( $status ) {
$RT::Logger-error(Unable to set Resolved date to ticket #$id: $msg);
return 0;
}
$RT::Logger-debug(Set Resolved date of ticket #. $id .  to . 
$stalled_date-ISO);
return 1;
===

 Action2. Update due date on un-stall =
my $t = $self-TicketObj;
my $id = $t-Id;
use Business::Hours;

my $now = RT::Date-new( $RT::SystemUser );
$now-SetToNow;
my $bhours = Business::Hours-new();
$bhours-business_hours( %{ $RT::ServiceBusinessHours{ 'Default' } } );
my $delta = $bhours-between($t-ResolvedObj-Unix, $now-Unix);
my $new_due = $bhours-add_seconds($t-DueObj-Unix, $delta);

my $due_date = RT::Date-new( $RT::SystemUser );
$due_date-Set(Format = 'unix', Value = $new_due );
# finally set new due date
my ($status, $msg) = $t-_Set(
   Field = 'Due',
   Value = $due_date-ISO,
   RecordTransaction = 0
);
# if the two transitions (*-stalled and stalled-*) take place out of hours,
# in the same interval, then $delta will be 0
if( !($t-DueObj-Diff($due_date)) ) {
$RT::Logger-debug(Unable to set Due date to ticket #$id: new_due_date = 
old_due_date  . $due_date-ISO);
}
elsif ( !($status) )  {
$RT::Logger-error(Unable to set Due date to ticket #$id: $msg);
return 0;
}
# reset Resolved date
($status, $msg) = $t-_Set(
   Field = 'Resolved',
   Value = 0,
   RecordTransaction = 0
);
unless ( $status ) {
$RT::Logger-error(Unable to reset Resolved date to ticket #$id: $msg);
}
$RT::Logger-debug(Due date updated after un-stalling ticket #. $id );
return 1;
==



Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.ithttp://al.sco...@reply.it
www.reply.ithttp://www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any

[rt-users] R: [SLA] Custom (and very imperfect) solution for parking stalled tickets

2012-06-09 Thread Scotto Alberto
Much better, following KISS rule: we could simply use hidden CFs to store 
temporary values!
This way it's much cleaner, isn't it?

The only pain is that I would have to reconfigure ACL, since I used to give 
Everyone the SeeCustomField right.
BTW ACL is not much featured at all... In this case it would be great if I 
could *deny* the SeeCustomField right for just one specific CF, instead of 
having to *grant* the right selectively.

Anyway, IMHO disallowing the update of some of the tickets' attributes is still 
useful (e.g. to avoid that malicious AdminCCs set Due date forward) and still 
I'd like some help about it.

Thank you,
have a nice week end





Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it



Inizio: Scotto Alberto
Inviato: sabato 9 giugno 2012 19.38
Fine: Ruslan Zakirov
Cc: rt-users@lists.bestpractical.com
Oggetto: R: [rt-users] [SLA] Custom (and very imperfect) solution for parking 
stalled tickets

Yep, I think it would be cool.
But you should also help me dealing with assumption #2: I'd like to disallow 
the modification of the tickets' attributes involved. Maybe not to everyone; 
maybe we could work with ACEs, splitting the ModifyTicket right in ModifyTicket 
and ModifyDates, or something like that.
What do you think?





Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.itUrlBlockedError.aspx
www.reply.itUrlBlockedError.aspx



Inizio: Ruslan Zakirov [ruslan.zaki...@gmail.com]
Inviato: sabato 9 giugno 2012 13.21
Fine: Scotto Alberto
Cc: rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] [SLA] Custom (and very imperfect) solution for parking 
stalled tickets


I'm glad if it works for you. Would like to see functionality in extension. 
Your solution needs refactoring to be merged. If you like I can guide you and 
help put it into shape for merge.

Ruslan from phone.

08.06.2012 2:24 пользователь Scotto Alberto 
al.sco...@reply.itmailto:al.sco...@reply.it написал:
Working with the SLA Extension, I came across the problem of stalled tickets: 
by default, there is no way to stop the timer for the due date when a ticket 
becomes stalled, as stated by the author in
http://www.gossamer-threads.com/lists/rt/users/105845#105845

So I've just implemented a small customization (very imperfect indeed) and I 
want to share it with all of you. Feel free to contribute, and please share 
your improvements.

First of all, a few assumptions (aka limitations):
- in $RT::ServiceBusinessHours we defined only 'Default' ServiceBusinessHours
- users will not modify the date fields we set, otherwise everything would 
screw up

The idea is to move the due date forward as soon as the ticket exits the 
stalled status. To compute the new due date we need to know when the tickets 
became stalled. So, we first have to save somewhere the time when it became 
stalled: we temporarly save it in the Resolved attribute (very dirty, I 
know..!), which shouldn't be used while stalled.

This solution includes two actions, two conditions, and two scrips which put 
everything together.

Conditions, which you can easily build thanks to sbin/rt-setup-database and the 
ExecModule StatusChange:
- on stalled
- on un-stall

Actions (the code is below):
- Set resolved temporarly
- Update due date on un-stall

Scrips:
- On stalled Set resolved temporarly
- On un-stall Update due date


I think the most important improvement would be to avoid the use of the 
Resolved attribute as temporary. Instead, it would be better to define a new 
private attribute in Ticket.pm; consequently, a new column in the DB, etc.

Of course, I will appreciate any suggestions, comments, etc.

Thanks

AS


 Action1. Set resolved temporarly =
my $tkt = $self-TicketObj;
my $id = $tkt-Id;
my $stalled_date = RT::Date-new( $RT::SystemUser );
$stalled_date-SetToNow;
my ($status, $msg) = $tkt-_Set(
   Field = 'Resolved',
   Value = $stalled_date-ISO,
   RecordTransaction = 0
);
unless ( $status ) {
$RT::Logger-error(Unable to set Resolved date to ticket #$id: $msg);
return 0;
}
$RT::Logger-debug(Set Resolved date of ticket #. $id .  to . 
$stalled_date-ISO);
return 1;
===

 Action2. Update due date on un-stall =
my $t = $self-TicketObj;
my $id = $t-Id;
use Business::Hours;

my $now = RT::Date-new( $RT::SystemUser );
$now-SetToNow;
my $bhours = Business::Hours-new();
$bhours-business_hours( %{ $RT::ServiceBusinessHours{ 'Default' } } );
my $delta = $bhours-between($t-ResolvedObj-Unix, $now-Unix);
my $new_due = $bhours-add_seconds($t-DueObj-Unix, $delta);

my $due_date = RT::Date-new( $RT::SystemUser );
$due_date-Set(Format = 'unix', Value = $new_due );
# finally set new due date
my ($status, $msg) = $t-_Set(
   Field = 'Due',
   Value = $due_date-ISO,
   RecordTransaction = 0

[rt-users] SeeGroupDashboard - trying to let group A see group B's dashboards

2012-06-09 Thread Scotto Alberto
I'm trying to let group A see group B's dashboards, where A and B are not 
related as subgroups
What I did was:
Went to Admin/Groups/GroupRights.html?id=group_b_id
Typed 'A' in the field Add group
Ticked SeeGroupDashboard right.

But it doesn't work.
May be some kind of a bug in the ACL system?
I'm on RT 4.0.2

Generally speaking, is it correct my interpretation of the ACL user interface, 
GroupRights.html page?
I mean, if I am in Groups/GroupRights.html?id=X, and I select a group on the 
left, say Everyone, ticking rights means grant Everyone the right to do this 
or that to Group X, doesn't it?
As well as, if I am in Queues/GroupRights.html?id=Y, and I select a group on 
the left, say Everyone, ticking rights means grant Everyone the right to do 
something on Queue Y

Thanks



Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

[rt-users] [SLA] Custom (and very imperfect) solution for parking stalled tickets

2012-06-07 Thread Scotto Alberto
Working with the SLA Extension, I came across the problem of stalled tickets: 
by default, there is no way to stop the timer for the due date when a ticket 
becomes stalled, as stated by the author in
http://www.gossamer-threads.com/lists/rt/users/105845#105845

So I've just implemented a small customization (very imperfect indeed) and I 
want to share it with all of you. Feel free to contribute, and please share 
your improvements.

First of all, a few assumptions (aka limitations):
- in $RT::ServiceBusinessHours we defined only 'Default' ServiceBusinessHours
- users will not modify the date fields we set, otherwise everything would 
screw up

The idea is to move the due date forward as soon as the ticket exits the 
stalled status. To compute the new due date we need to know when the tickets 
became stalled. So, we first have to save somewhere the time when it became 
stalled: we temporarly save it in the Resolved attribute (very dirty, I 
know..!), which shouldn't be used while stalled.

This solution includes two actions, two conditions, and two scrips which put 
everything together.

Conditions, which you can easily build thanks to sbin/rt-setup-database and the 
ExecModule StatusChange:
- on stalled
- on un-stall

Actions (the code is below):
- Set resolved temporarly
- Update due date on un-stall

Scrips:
- On stalled Set resolved temporarly
- On un-stall Update due date


I think the most important improvement would be to avoid the use of the 
Resolved attribute as temporary. Instead, it would be better to define a new 
private attribute in Ticket.pm; consequently, a new column in the DB, etc.

Of course, I will appreciate any suggestions, comments, etc.

Thanks

AS


 Action1. Set resolved temporarly =
my $tkt = $self-TicketObj;
my $id = $tkt-Id;
my $stalled_date = RT::Date-new( $RT::SystemUser );
$stalled_date-SetToNow;
my ($status, $msg) = $tkt-_Set(
   Field = 'Resolved',
   Value = $stalled_date-ISO,
   RecordTransaction = 0
);
unless ( $status ) {
$RT::Logger-error(Unable to set Resolved date to ticket #$id: $msg);
return 0;
}
$RT::Logger-debug(Set Resolved date of ticket #. $id .  to . 
$stalled_date-ISO);
return 1;
===

 Action2. Update due date on un-stall =
my $t = $self-TicketObj;
my $id = $t-Id;
use Business::Hours;

my $now = RT::Date-new( $RT::SystemUser );
$now-SetToNow;
my $bhours = Business::Hours-new();
$bhours-business_hours( %{ $RT::ServiceBusinessHours{ 'Default' } } );
my $delta = $bhours-between($t-ResolvedObj-Unix, $now-Unix);
my $new_due = $bhours-add_seconds($t-DueObj-Unix, $delta);

my $due_date = RT::Date-new( $RT::SystemUser );
$due_date-Set(Format = 'unix', Value = $new_due );
# finally set new due date
my ($status, $msg) = $t-_Set(
   Field = 'Due',
   Value = $due_date-ISO,
   RecordTransaction = 0
);
# if the two transitions (*-stalled and stalled-*) take place out of hours,
# in the same interval, then $delta will be 0
if( !($t-DueObj-Diff($due_date)) ) {
$RT::Logger-debug(Unable to set Due date to ticket #$id: new_due_date = 
old_due_date  . $due_date-ISO);
}
elsif ( !($status) )  {
$RT::Logger-error(Unable to set Due date to ticket #$id: $msg);
return 0;
}
# reset Resolved date
($status, $msg) = $t-_Set(
   Field = 'Resolved',
   Value = 0,
   RecordTransaction = 0
);
unless ( $status ) {
$RT::Logger-error(Unable to reset Resolved date to ticket #$id: $msg);
}
$RT::Logger-debug(Due date updated after un-stalling ticket #. $id );
return 1;
==



Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

[rt-users] Priority greater than 99

2012-06-06 Thread Scotto Alberto
Hi all,
I was wondering if setting Priority to a value greater than 99 (max allowed as 
documented) could bring to some problems.
I think it would be useful to escalate overdue tickets incrementing the 
Priority by 1 every hour. Otherwise a ticket overdue since 10 minutes would 
have the same priority as one overdue since 10 days.

Thanks for any help

AS



Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

[rt-users] R: Built-in field validation (Priority)

2012-06-04 Thread Scotto Alberto
I think this is exactly what you are looking for

http://search.cpan.org/dist/RT-Extension-MandatoryFields/

There are also two more specific extensions:
http://search.cpan.org/dist/RT-Extension-MandatoryRequestor/
http://search.cpan.org/dist/RT-Extension-MandatorySubject/

BTW I suggest you to look through all the extensions you can find here:
http://requesttracker.wikia.com/wiki/Extensions
and here:
http://requesttracker.wikia.com/wiki/Extensions
And finally here you can find other contributions (scrips/templates/etc.):
http://requesttracker.wikia.com/wiki/Contributions

Regards

Alberto


Inizio: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di TheHoboKing 
[demon_eyes_ky...@hotmail.com]
Inviato: lunedì 4 giugno 2012 18.57
Fine: rt-users@lists.bestpractical.com
Oggetto: [rt-users]  Built-in field validation (Priority)

Hello all,

Is there a way to validate data entered in one of RT's 'built-in' field
(i.e: Priority)? I couldn't find any option to select RT's built-in fields
and set any sort of mandatory/validation parameter.

I can validate the entered data via a scrip but then I don't know how to
force the Update or Create form to be reloaded and display a message stating
['Priority' field must match 'XYZ']. (as it behaves for CustomFields).

Thank you
--
View this message in context: 
http://old.nabble.com/Built-in-field-validation-%28Priority%29-tp33959201p33959201.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


[rt-users] R: R: Built-in field validation (Priority)

2012-06-04 Thread Scotto Alberto
Got it! That mandatory misleaded me .. :)

Maybe this could be of some help/inspiration to you:
http://requesttracker.wikia.com/wiki/ValidateEmail

Besides, there may be some callbacks you may find useful (just supposing):
cd /opt/rt4/
find share/html | xargs grep '\-callback'

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


AS

Inizio: rt-users-boun...@lists.bestpractical.com 
[rt-users-boun...@lists.bestpractical.com] per conto di TheHoboKing 
[demon_eyes_ky...@hotmail.com]
Inviato: lunedì 4 giugno 2012 23.36
Fine: rt-users@lists.bestpractical.com
Oggetto: Re: [rt-users] R:   Built-in field validation (Priority)

Hi Alberto,

I've previously looked and installed RT-Extension-MandatoryFields but it
only seems to enforce the field(s) to be filled, what I'm looking for is a
way to validate the date entered, in my case I'd like to limit Priority to
an integer between 0 and 100, anything besides number and past 100 should
not be a valid input.

Hope it makes things more clear.

Thanks!



Scotto Alberto wrote:

 I think this is exactly what you are looking for

 http://search.cpan.org/dist/RT-Extension-MandatoryFields/

 There are also two more specific extensions:
 http://search.cpan.org/dist/RT-Extension-MandatoryRequestor/
 http://search.cpan.org/dist/RT-Extension-MandatorySubject/

 BTW I suggest you to look through all the extensions you can find here:
 http://requesttracker.wikia.com/wiki/Extensions
 and here:
 http://requesttracker.wikia.com/wiki/Extensions
 And finally here you can find other contributions (scrips/templates/etc.):
 http://requesttracker.wikia.com/wiki/Contributions

 Regards

 Alberto

 
 Inizio: rt-users-boun...@lists.bestpractical.com
 [rt-users-boun...@lists.bestpractical.com] per conto di TheHoboKing
 [demon_eyes_ky...@hotmail.com]
 Inviato: lunedì 4 giugno 2012 18.57
 Fine: rt-users@lists.bestpractical.com
 Oggetto: [rt-users]  Built-in field validation (Priority)

 Hello all,

 Is there a way to validate data entered in one of RT's 'built-in' field
 (i.e: Priority)? I couldn't find any option to select RT's built-in fields
 and set any sort of mandatory/validation parameter.

 I can validate the entered data via a scrip but then I don't know how to
 force the Update or Create form to be reloaded and display a message
 stating
 ['Priority' field must match 'XYZ']. (as it behaves for CustomFields).

 Thank you
 --
 View this message in context:
 http://old.nabble.com/Built-in-field-validation-%28Priority%29-tp33959201p33959201.html
 Sent from the Request Tracker - User mailing list archive at Nabble.com.



 Alberto Scotto

 Blue Reply
 Via Cardinal Massaia, 83
 10147 - Torino - ITALY
 phone: +39 011 29100
 al.sco...@reply.it
 www.reply.it


 

 --
 The information transmitted is intended for the person or entity to which
 it is addressed and may contain confidential and/or privileged material.
 Any review, retransmission, dissemination or other use of, or taking of
 any action in reliance upon, this information by persons or entities other
 than the intended recipient is prohibited. If you received this in error,
 please contact the sender and delete the material from any computer.


--
View this message in context: 
http://old.nabble.com/Built-in-field-validation-%28Priority%29-tp33959201p33960783.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.



Alberto Scotto

Blue Reply
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.


[rt-users] Merge Users History - Broken link on bestpractical's web site

2012-06-03 Thread Scotto Alberto
Hi,
I noticed that the link to the extension MergeUsersHistory on 
http://bestpractical.com/rt/extensions.html is broken.
Here is the broken link: 
http://search.cpan.org/dist/RT-Extension-MergeUsersHistory/lib/RT/Extension/MergeUsersHistory.pm
Looks like it isn't hosted by cpan anymore..?
However the link to the source code is still active, so I was able to download 
the package and install it.
BTW it works like a charm! Thank you ruz!!

AS



Alberto Scotto

[Blue]
Via Cardinal Massaia, 83
10147 - Torino - ITALY
phone: +39 011 29100
al.sco...@reply.it
www.reply.it




--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.
inline: blue.png

[rt-users] Autocomplete feature for unprivileged users ( AllowUserAutocompleteForUnprivileged?)

2012-05-28 Thread SCOTTO Alberto (Consultant) (FIAT POWERTRAIN TECHNOLOGIES)
Hi all,

I can't get the autocomplete email address feature to work for unprivileged 
people who access the SelfService area.
It is correctly set in RT_SiteConfig, as I can also see in RT's web UI, tools  
system configuration: AllowUserAutocompleteForUnprivileged=1
I'm experiencing this problem both on RT 4.0.2 and 4.0.6.

I am starting to think that I misunderstand the meaning of the 
AllowUserAutocompleteForUnprivileged config!

Here is what happens if I login as an unprivileged user and go in the 
SelfService/Create.html page, as Firebug says: as I type a bunch of characters 
in the requestors or cc field, RT returns a 302 HTTP status code (found), and 
then redirects me to SelfService/

Any help appreciated.
Thank you


Alberto Scotto
Information Technologies Consultant

FIAT POWERTRAIN TECHNOLOGIES S.p.A.
Corso Settembrini 167, 10135 Torino, Italia

[rt-users] Charts displaying only sometimes (GD problem?)

2011-11-23 Thread Scotto Alberto
Hi all,
I'm having problems with charts, both bar and pie charts. Little context: 
created new dashboard and new saved search (privately at group-level); trying 
to display a nice report in the form of a bar chart.
It happens that *under certain conditions* RT doesn't show any chart. Actually 
apache does not generatereturn the image, as if I point Chrome to the link of 
the image [1], then it returns Error 324 (net::ERR_EMPTY_RESPONSE) The server 
closed the connection without sending any data.
Up to now I found the following conditions (not excluding each other) that 
influence the displaying or not of a chart:
- type of chart (bar vs. pie)
- domain on X axis (queue/owner name/owner email address/etc.)
- language set in the user preferences
- user logged in

Eg. given chart A:
- if I login with user1 it shows, but with user2 it does not;
- given a user, if I select bar,queue it doesn't show, but bar, 
CreatorNickname works
- given a user and a certain pair type_of_chart, domain_on_x_axis, it works 
if I turn to English from user preferencies; it doesn't if I select Italian
- and so on...

I'm using RT 4.0.2 (never upgraded, it's a fresh install) on Red Hat Enterprise 
Linux AS release 4 (Nahant Update 2) with Apache/2.0.52, mod_perl ??, GD::Graph 
1.44, glibc-2.3.4-2.13

CLUES:

1a. as soon as my browser asks for the image and RT doesn't generate it, RT 
prints in /opt/rt4/var/log/apache2.error the following 2 lines:
*** glibc detected *** free(): invalid pointer: 0x0dd16764 *** [Wed Nov 23 
16:38:23 2011] [notice] child pid 10963 exit signal Aborted (6), possible 
coredump in /tmp/apache_core_dumps

1b. There's something more. Here's what apache's core dump says (resulting from 
the commands gdb /usr/sbin/httpd /tmp/apache_core_dumps/core.22613 + bt full):

#0  0x0096c7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 No symbol table 
info available.
#1  0x006a07d5 in raise () from /lib/tls/libc.so.6 No symbol table info 
available.
#2  0x006a2149 in abort () from /lib/tls/libc.so.6 No symbol table info 
available.
#3  0x006d440a in __libc_message () from /lib/tls/libc.so.6 No symbol table 
info available.
#4  0x006dab3f in _int_free () from /lib/tls/libc.so.6 No symbol table info 
available.
#5  0x006daeba in free () from /lib/tls/libc.so.6 No symbol table info 
available.
#6  0x00cb2a57 in gdFree () from /usr/lib/libgd.so.2 No symbol table info 
available.
#7  0x00be9c36 in XS_GD__Image_png (my_perl=0x9b85a98, cv=0xa875550)
at GD.xs:944
data = (void *) 0xcec9a44
size = 3545
level = Variable level is not available.


2. after enabling logging by adding Set($LogToFile, debug) to 
RT_Site_Config.pm, I noticed the following message in rt.log:
[Wed Nov 23 10:56:18 2011] [debug]: You've enabled GraphViz, but we couldn't 
load the module: Can't locate GraphViz.pm in @INC (@INC contains: [...] at 
/opt/rt4/sbin/../lib/RT/Config.pm line 542. 
(/opt/rt4/sbin/../lib/RT/Config.pm:543)

Clue #2 doesn't sound a good one to me, though. In fact I am trying to display 
charts not graphs! I read about showing relationships between tickets [2], but 
I'm not interested in that! Just wanted to extract some nice monthly reports as 
bar charts :) Then, I should not need to install Graphviz, should I?

Here's what I tried to do:
- clean mason cache (more than once)
- clean browser's cache (more than once)
- reinstalled GD::Image (with cpan 'force install')
- added Set($DisableGD, undef) to RT_Site_Config.pm, as well as Set($DisableGD, 
0)

According to clue#1b it's GD that breaks everything (at GD.xs:944). Can you 
confirm my interpretation is correct? If so, maybe I could go for a reinstall 
of GD..?
Otherwise I could upgrade glibc, to what version?
Nevertheless, I *feel* like it's a cache problem, server-side. Not client-side 
because cleaning browser's cache doesn't help. I don't know if there exists a 
server-side cache in RT other than mason cache(which I already cleaned), 
however it's my own best explanation. In fact, if it were glibc or GD, I should 
never ever get any charts then! While sometimes I do!

Can anyone point me in the right direction?
Thank you very much in advance.

Alberto


[1] 
http://mydomain.com/Search/Chart?Class=RT%3A%3ATicketsFormat=Query=(%20Queue%20%3D%20'EstesaP'%20OR%20Queue%20%3D%20'EstesaI'%20)%20AND%20Created%20%3E%20'-30%20days'Rows=10SavedSearchId=RT%3A%3AGroup-126-SavedSearch-33SearchType=ChartShowNavigation=0hideable=1

[2] http://www.gossamer-threads.com/lists/rt/users/91783#91783


PS: If you need more examples/tests/information for debugging, please ask me.



--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in