Sunday, October 10, 2010

Auto-close PARENT incidents in etrack

Download etrack CLI package for linux from https://engtools.engba.symantec.com/tools/etrackclipage.html. Untar the package to some location and add softlink in /usr/local/etrack

sudo ln -s /home/username/etrack5.3 /usr/local/etrack
Enable auto-login by running elogin script from /usr/local/etrack/perl/bin/elogin, which should ask for your username and store password in ~/.epass (plaintext) and all subsequent etrack commands would use this password

Create a script to automatically close all completed PARENT incidents using

echo "select incident from incident_view outer where version='PARENT' and state!='CLOSED' and assigned_to='' and incident not in (select superincident from incident_view inner where outer.incident=inner.superincident and state!='CLOSED')" | /usr/local/etrack/perl/bin/esql |
while read incident; do
echo "childs closed" | /usr/local/etrack/perl/bin/eclose -i $incident -r "SERVICE_COMPLETED" -B
done
Example to set any field in etrack to empty

/usr/local/etrack/perl/bin/eset -T @ -i $incident # will set target_version to empty for $incident

No comments:

Post a Comment