#!/bin/sh PT_URL="https://prod.practitest.com" PT_API_KEY="you account key" PT_API_SECRET_KEY="your account secret key" PT_PREFIX="#" #the prefix for the issue ID, so in your comment you can write so can write something like 'fixed #328' TS=`date +%s` SIGNATURE=`md5 -q -s $PT_API_KEY$PT_API_SECRET_KEY$TS` REPOS="$1" TXN="$2" SVNLOOK=/usr/bin/svnlook SVN_MESSAGE=`$SVNLOOK log --transaction "$TXN" "$REPOS"` SVN_AUTHOR=`$SVNLOOK author --transaction "$TXN" "$REPOS"` ISSUE_IDS=`echo -n "$SVN_MESSAGE" | grep -oE "$PT_PREFIX[[:digit:]]{1,}" | tr "\n" "," | sed "s/$PT_PREFIX//g" | sed "s/,\$//g"` PT_REQUEST="$PT_API_KEY$PT_API_SECRET_KEY$SVN_AUTHOR$ISSUE_IDS" PT_RESPONSE=`echo -n $PT_REQUEST | curl -s -X POST -H 'Content-type: text/xml' -d @- "$PT_URL/change_sets/validate_assignee.xml?api_key=$PT_API_KEY&ts=$TS&signature=$SIGNATURE"` if [ $? -ne 0 ]; then echo "Failed to communicate with PractiTest server $PT_URL!" >&2 exit 1 fi if [ "$PT_RESPONSE" = "OK" ]; then exit 0 else echo "Please make sure you have at least one PractiTest issue ID in the comment (${PT_PREFIX}XXX) and that it is assigned to you: $PT_RESPONSE" >&2 exit 1 fi