Scrip ordering and commmitting

One of our users would like to be added to a ticket as an AdminCc
(and be notified) whenever a particular requestor sends (new) mail to
the queue. I thought I could do this by taking advantage of the
scrip-ordering feature:

00 On Create User Defined (add user as AdminCc if requestor matches a list)
99 On Create Notify AdminCc …

The first part works fine - the user is added to the ticket as
AdminCc. However, the second scrip finds no AdminCcs and sends no
mail (No recipients found. Not sending). The scrips are definitely
executing in the expected order - the RT log tells me so.

I thought that for a given transaction, each scrip was committed in
order - so I expected scrip 99 to see the new AdminCc and send mail.
But apparently not.

Can anyone explain why the newly minted AdminCc does not get a notification?

Thanks,
Steve

Stephen Turner
Senior Programmer/Analyst - Client Support Services
MIT Information Services and Technology (IS&T)

One of our users would like to be added to a ticket as an AdminCc
(and be notified) whenever a particular requestor sends (new) mail to
the queue. I thought I could do this by taking advantage of the
scrip-ordering feature:

00 On Create User Defined (add user as AdminCc if requestor matches a list)
99 On Create Notify AdminCc …

The first part works fine - the user is added to the ticket as
AdminCc. However, the second scrip finds no AdminCcs and sends no
mail (No recipients found. Not sending). The scrips are definitely
executing in the expected order - the RT log tells me so.

I thought that for a given transaction, each scrip was committed in
order - so I expected scrip 99 to see the new AdminCc and send mail.
But apparently not.

Can anyone explain why the newly minted AdminCc does not get a notification?
Notification scrip fetches list of recipients during prepare.

Thanks,
Steve

Stephen Turner
Senior Programmer/Analyst - Client Support Services
MIT Information Services and Technology (IS&T)


The rt-users Archives

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

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

Best regards, Ruslan.

At Monday 1/28/2008 01:56 PM, you wrote:>On Jan 28, 2008 7:50 PM, Stephen Turner sturner@mit.edu wrote:

Can anyone explain why the newly minted AdminCc does not get a
notification?
Notification scrip fetches list of recipients during prepare.

Ah - thanks. I solved my problem by using a single scrip, adding the
new AdminCc in the condition step.

Thanks,
Steve

Hi,

i wrote 2 scripts and it would be nice, if somebody could have a look on
the code to see bugs or improvements.
The first one ‘createQueue_Groups.pm’ creates a queue, 4 groups and sets
predefined rights for this groups.
The second script ‘addUserToGroup.pm’ creates new users which are
described in a separate file and add them to existing groups.
Soon we might get a bigger amount of new users on our rt system and
therefore we need this scripts to create in a quick way the new objects.
Here the scripts:
www.desy.de/~alexk/createQueue_Groups.pm and addUserToGroup.pm

Best regards
Alexander

I would suggest reading Learning Perl. You have a lot of unnecessary code.

You should not be using private methods ($Groupy->_Create).On 2/7/08, Krieg, Alexander alexander.krieg@desy.de wrote:

Hi,

i wrote 2 scripts and it would be nice, if somebody could have a look on
the code to see bugs or improvements.
The first one ‘createQueue_Groups.pm’ creates a queue, 4 groups and sets
predefined rights for this groups.
The second script ‘addUserToGroup.pm’ creates new users which are
described in a separate file and add them to existing groups.
Soon we might get a bigger amount of new users on our rt system and
therefore we need this scripts to create in a quick way the new objects.
Here the scripts:
www.desy.de/~alexk/createQueue_Groups.pm and addUserToGroup.pm

Best regards
Alexander


The rt-users Archives

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

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

Hi Alexander,
thats perfekt, this is what i’m looking for since a long time. Will try it
out asap.

Torsten2008/2/7, Krieg, Alexander alexander.krieg@desy.de:

Hi,

i wrote 2 scripts and it would be nice, if somebody could have a look on
the code to see bugs or improvements.
The first one ‘createQueue_Groups.pm’ creates a queue, 4 groups and sets
predefined rights for this groups.
The second script ‘addUserToGroup.pm’ creates new users which are
described in a separate file and add them to existing groups.
Soon we might get a bigger amount of new users on our rt system and
therefore we need this scripts to create in a quick way the new objects.
Here the scripts:
www.desy.de/~alexk/createQueue_Groups.pm and addUserToGroup.pm

Best regards
Alexander


The rt-users Archives

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

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

MFG

Torsten Brumm

http://www.torsten-brumm.de

Hi Alexander,
just had a look onto your http://www.desy.de/~alexk/addUserToGroup.pm and
found:

my ($code, $msg) = $user->Create(Name =>$Login, Password =>‘test1234’,
RealName =>$FnLn, EmailAddress =>$Email, Privileged =>0);

Privileged =>0
so you want them to be Unprivileged?

Torsten2008/2/7, Krieg, Alexander alexander.krieg@desy.de:

Hi,

i wrote 2 scripts and it would be nice, if somebody could have a look on
the code to see bugs or improvements.
The first one ‘createQueue_Groups.pm’ creates a queue, 4 groups and sets
predefined rights for this groups.
The second script ‘addUserToGroup.pm’ creates new users which are
described in a separate file and add them to existing groups.
Soon we might get a bigger amount of new users on our rt system and
therefore we need this scripts to create in a quick way the new objects.
Here the scripts:
www.desy.de/~alexk/createQueue_Groups.pm and addUserToGroup.pm

Best regards
Alexander


The rt-users Archives

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

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

MFG

Torsten Brumm

http://www.torsten-brumm.de

Hi Alexander,
it’s me again…

Another thing i found:

For your “Source” File Format:

[YourGroupname]
    User1Login,User1_Email,User1Firstname User1Lastname
    User2Login,User2_Email,User2Firstname User2Lastname
[YourGroupname1]
User3Login,User3_Email,User3Firstname User3Lastname

What will happen, if a users needs to be in Group1 and in Group2 ??

Torsten2008/2/7, Krieg, Alexander alexander.krieg@desy.de:

Hi,

i wrote 2 scripts and it would be nice, if somebody could have a look on
the code to see bugs or improvements.
The first one ‘createQueue_Groups.pm’ creates a queue, 4 groups and sets
predefined rights for this groups.
The second script ‘addUserToGroup.pm’ creates new users which are
described in a separate file and add them to existing groups.
Soon we might get a bigger amount of new users on our rt system and
therefore we need this scripts to create in a quick way the new objects.
Here the scripts:
www.desy.de/~alexk/createQueue_Groups.pm and addUserToGroup.pm

Best regards
Alexander


The rt-users Archives

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

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

MFG

Torsten Brumm

http://www.torsten-brumm.de