RE: [otrs-de] Unlock von allen Tickets eines Benutzers (Urlaub).

Hallo, hatte doch glatt das Scripts Verzeichnis übersehen :). Nutze nun den Generics Agent und mache das "otrs.getUserId username" im Shell Skript drumrum. The GenericsAgentUrlaub.pm looks like this: ----------------------- o<---------------------- if (!$ENV{HOLIDAY_USER}) {exit;} [...] 'unlock all tickets from user (holiday)' => { UserIDs => [$ENV{HOLIDAY_USER}], States => ['new','open','waiting external','pending auto close+' , 'pending auto close-', 'pending reminder'], New => { Owner => 'root@localhost', Lock => 'unlock', }, } [...] ----------------------- o<---------------------- Wrapper sieht so aus: ----------------------- o<---------------------- #!/bin/bash function usage() { echo "" echo "usage $(basename $0): $(basename $0) <username> [<username> ... <username>]" echo "" echo " This script unlocks all non-closed tickets owned by user <username>" echo " (username must be the \"login\" of the OTRS user)" echo "" echo "EXAMPLE: $(basename $0) heinzmann richter" echo " This unlocks all non closed tickets locked by OTRS users \"heinzmann\" and \"richter\"" echo "" echo "It can be used for holiday purpose" echo " -- Heinzmann@cc-dresden.de" echo "" exit 1 } if [ -z "$1" ];then usage fi while [ ! -z "$1" ]; do userID=$(/opt/otrs/bin/otrs.getUserID $1 2>/dev/null); userID=$(echo $userID | grep -e "^[0-9][0-9]*$") if [ -z "$userID" ];then echo "" echo "WARNING: User $1 not existing, skipping..." echo "" else echo "" echo "Processing $1... (userid: $userID)" export HOLIDAY_USER="$userID"; /opt/otrs/bin/GenericAgent.pl -c "Kernel::Config::GenericAgentUrlaub" fi shift done
participants (1)
-
Heinzmann, Robert