Skip to content

Commit

Permalink
updated to print ticket url
Browse files Browse the repository at this point in the history
  • Loading branch information
ckannan committed Mar 19, 2010
1 parent bc5b007 commit b5dd731
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions create-task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ formtoken=$( cat cookies.txt | grep trac_form_token | cut -f 7 | tr -d "\r" )

# login; try to log in either form based or with HTTP authentication
# make it in a single run; instead just doing both ways works - either one will work
echo "Logging into $agilo"
#echo "Logging into $agilo"
# try logging login for form based login
loginData="__FORM_TOKEN=$formtoken&user=$user&password=$pass"
curl -s -b "$cookies" -c "$cookies" -d "$loginData" $agilo/login > /dev/null
Expand All @@ -36,12 +36,12 @@ curl -s -b "$cookies" -c "$cookies" --digest -u "$user:$pass" $agilo/login > /
# create task

DATA="field_summary=${task_summary}&field_reporter=${task_reporter}&field_description=${task_description}&field_remaining_time=${task_remaining_time}&field_status=new&submit=Create%2BTicket&field_type=task&__FORM_TOKEN=${formtoken}"
curl -s -d "${DATA}" -b "$cookies" $agilo/newticket > /dev/null
if [ $? -ne 0 ];
ticket_url=`curl -s -d "${DATA}" -i -b "$cookies" $agilo/newticket | grep Location | grep -i ticket | awk '{print $2}'`
if [ -n $ticket_url ];
then
echo "ERROR: Problem creating task"
echo "Task created = $ticket_url"
else
echo "Task created"
echo "ERROR: problem creating ticket"
fi

rm "$cookies"
Expand Down

0 comments on commit b5dd731

Please sign in to comment.