Skip to content

Instantly share code, notes, and snippets.

@zeyadetman
Created January 18, 2022 12:58
Show Gist options
  • Select an option

  • Save zeyadetman/c6375b456ba14a1557646b4acbfe7c70 to your computer and use it in GitHub Desktop.

Select an option

Save zeyadetman/c6375b456ba14a1557646b4acbfe7c70 to your computer and use it in GitHub Desktop.
#!bin/bash
pushit () {
echo "Getting data...";
jira issue list -a"Zeyad Etman" -s"IN PROGRESS";
echo "\nPlease enter ticket id: "
read id;
echo "\n"
desc=$(jira issue list -q "key = $id" --plain);
A=$(awk -F"$id" '{print $2}' <<< $desc)
B=$(awk -F"In Progress" '{print $1}' <<< $A | xargs echo -n)
commitMessage="$id: $B"
echo "\n$commitMessage"
echo "Pushing and committing...\n"
git checkout -b $id
git add .
git commit -m "$commitMessage"
git push origin $id
}
pushit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment