Skip to content

Instantly share code, notes, and snippets.

@doctorallen
Created December 2, 2013 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doctorallen/7759846 to your computer and use it in GitHub Desktop.
Save doctorallen/7759846 to your computer and use it in GitHub Desktop.
Updating Trac with custom fields
[ticket-custom]
progress = select
progress.label = Progress
progress.options = not started yet|started|ready for QA|tested but has bugs|testing passed|ready for staging|posted to staging|ready for production|posted to production|needs client approval|needs client feedback|needs PM clarification|can't replicate
estimate = text
estimate.format = plain
estimate.label = Hour Estimate
percent = select
percent.label = Percent Complete
percent.options = 0%|25%|50%|75%|100%
testing_required = checkbox
testing_required.label = Requires Testing
#! user/bin/perl
$path = '/data/trac/';
$file = '/conf/trac.ini';
print "Enter Name of project:";
$project = <>;
$project =~ s/\r|\n//g;
$projectdir = $path . $project;
$filename = $path . $project . $file;
print $filename;
if(-e $filename) {
print 'FOUND';
`cat ~/custom.ini >> $filename`;
`trac-admin $projectdir/ ticket_type add test`;
`trac-admin $projectdir/ ticket_type add define`;
`trac-admin $projectdir/ ticket_type add requirement`;
`trac-admin $projectdir/ priority add backlog`;
`trac-admin $projectdir/ ticket_type add deferred`;
}else{
print 'NOT FOUND';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment