Hi,
You have remind me that I was to make a universal version which also
allows form based login. I wanted to update wiki but seems it is not
open to public.

I've tested it with Agilo applience 0.7, but unfortunately 0.7 uses
different URL to do the links, so to use it in 0.7 you need to
uncomment the right curl command in the for loop. By default it is for
0.8. I didn't want to make too much integligence to it.

As for the web page, the problem is with time to maitain it.

Marcin



#!/bin/sh
# author: Marcin Okraszewski - okrasz_news -at- o2 -dot- pl

if [ $# -lt 6 ] ; then
  echo "This script creates links between story and tasks (and
hopefully other links as well)."
  echo
  echo "Syntax:"
  echo "   $0 AGILO_URL USER PASS STORY_ID TASK_ID_FROM TASK_ID_TO"
  echo "Where:"
  echo "   AGILO_URL - base URL to your Agilo project"
  echo "   USER - your user name"
  echo "   PASS - your password"
  echo "   STORY_ID - ID of the story that will have tasked linked"
  echo "   TASK_ID_FROM - ID of the first of tasks to link to story
(inclusive)"
  echo "   TASK_ID_TO - ID of the last task to link to the story
(inclusive)"
  echo
  echo "Example:"
  echo "    $0 http://localhost/demo admin adminPass 1 3 5"
  echo "This example will link tasks 3-5 to a story 1  "
  echo "in Agilo project http://localhost/demo";
  echo
  echo "NOTE: to link a single task, use the same number "
  echo "in TASK_ID_FROM and TASK_ID_TO"
  echo
  echo "(c) Marcin Okraszewski - okrasz_news -at- o2 -dot- pl"
  exit
fi

agilo=$1
user=$2
pass=$3
dst=$4
from=$5
to=$6

cookies=cookies.txt

# get form token
echo "Obtaining form token"
curl --digest -u "$user:$pass" -c "$cookies" $agilo > /dev/null
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
# unfortunately couldn't use post data and HTTP authentication to
# make it in a single run; instead just doing both ways works - either
one will work
echo "Logging into $agilo"
# try logging login for form based login
loginData="__FORM_TOKEN=$formtoken&user=$user&password=$pass"
curl -b "$cookies" -c "$cookies" -d "$loginData" $agilo/login > /dev/
null
# try logging with digest HTTP authentication
curl -b "$cookies" -c "$cookies" --digest -u "$user:$pass"  $agilo/
login > /dev/null

# create links
for (( i=$from ; i <= $to ; i++ )) ; do
  echo -n -e "\nlink $i to $dst "
  data="__FORM_TOKEN=$formtoken&url_orig=%2Fav%2Fticket%2F438%3Fpane
%3Dedit&src=$dst&dest=$i&autocomplete_parameter=&cmd=create+link"
  # for agilo 0.8
  curl  -e "$agilo/ticket/$dst"'?pane=edit' -b "$cookies" -d "$data"
$agilo/links 2>/dev/null
  # for agilo 0.7
  # curl  -e "$agilo/ticket/$dst"'?pane=edit' -b "$cookies" -d "$data"
$agilo/agilo-links 2>/dev/null
done

rm "$cookies"
-- 
Follow Agilo on Twitter: http://twitter.com/agiloforscrum
-----
You received this message because you are subscribed to the Google
Groups "Agilo for Scrum" group. This group is moderated by agile42 GmbH 
http://www.agile42.com and is focused in supporting Agilo for Scrum users.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/agilo?hl=en

Reply via email to