Git Restriction Command WIth JIRA ID
COMMIT_MSG_FILE=$1
COMMIT_SOURCE=$2
SHA1=$3
JIRAIDNAME=$4
#only prepare commit message if pattern matched and jiraId was found
echo $COMMIT_MSG_FILE
test=awk '{ print $1}' /d/GIT/Backup/TestSandy/.git/COMMIT_EDITMSG
out=$(curl https://xyz.atlassian.net/rest/api/3/issue/”$test” –user vuz@xyz.com:pHXlWFqT8EYYOJ7hHeb59C3E)
status=echo $out | grep "Issue does not exist or you do not have permission to see it."
if [ “$?” != “0” ]; then
echo “Jira ID exist”
else
echo “Jira ID doesn’t Exist”
exit 1
fi