On Fri, 22 Aug 2008 01:36:02 -0400, Graham Ballantyne <[EMAIL PROTECTED]>  
wrote:

> I'm working on a script to create users in RT based on a list of
> usernames. I need to add these users to an RT group upon creation. I
> can do it by doing an INSERT into the GroupMembers table, but I'm
> wondering if there's a more official and elegant way?
>
>

Graham,

You'll want to stay away from trying to use direct SQL commands for  
working with RT from a script. The RT Perl API is the way to go - there's  
a lot more to even the simplest sounding update than a single SQL  
statement, and the API does it all for you. There are examples in the  
wiki: http://wiki.bestpractical.com/view/Contributions - look under  
External Utils. The rt-adduser entry is a simple example that should get  
you started. The API is documented in the code itself, and you can use  
perldoc to see it.

Steve

_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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

Reply via email to