Skip to content

Instantly share code, notes, and snippets.

@ewieberappc
Last active September 14, 2018 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ewieberappc/f3fdba90e1f6b7643b6c to your computer and use it in GitHub Desktop.
Save ewieberappc/f3fdba90e1f6b7643b6c to your computer and use it in GitHub Desktop.
Search JIRA and open tickets from the command line
case "$1" in -h|--help) HELP='https://gist.github.com/ewieberappc/f3fdba90e1f6b7643b6c'; echo -ne '\t'$'\e[37m''Opening help URL: '"$HELP"'\n'$'\e[0m'; open "$HELP"; exit;; me) open 'https://jira.appcelerator.org/issues/?filter=-2';; "") set -o history; IN=$( history | tail -2 | head -1 | sed 's/[ 0-9]*//' ); if [[ "$IN" != 'jira'* ]]; then echo -ne "\r"; ${FUNCNAME[0]} $IN; else echo -ne "\r"; ${FUNCNAME[0]} -h; fi; exit;; -s|--search) STR=''; shift; while [ "${#}" -gt 0 ]; do if [[ "$STR" == '' ]]; then STR="$1"; else STR+='+'"$1"; fi; shift; done; STR=${STR// /\+}; open 'https://jira.appcelerator.org/issues/?jql='$STR; echo; echo -e '\nPerforming JIRA search\n';; *) echo; echo -e '\nOpening:'; for arg in "$@"; do TIC='https://jira.appcelerator.org/browse/'$(echo $arg | sed -n 's/\([a-zA-Z]*\)\(\-*\)\([0-9]*\)/\1-\3/p'); open $TIC; echo -e $TIC; done; echo;; esac;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment