Skip to content

Instantly share code, notes, and snippets.

@naftulikay
Created May 13, 2014 19:01
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 naftulikay/ec2acedeb1172c225150 to your computer and use it in GitHub Desktop.
Save naftulikay/ec2acedeb1172c225150 to your computer and use it in GitHub Desktop.
Generate JIRA Ticket Labels
#!/bin/bash
function generate-jira-label() {
# Generates a 256 square label, given a JIRA name matching the following pattern:
# (\w+)-(\d+)
# ie: AA-1234, JV-511
if [ -z "$1" ]; then
echo "Please provide a JIRA number like AA-1234 as the first argument." >&2
exit 1
fi
JIRA="$1"
JIRA_CODE="$(echo "$JIRA" | awk -F '-' '{print $1;}')"
JIRA_NUMBER="$(echo "$JIRA" | awk -F '-' '{print $2;}')"
convert -background white -fill black -font Droid-Sans-Bold -gravity center -size 256x256 \
label:"$JIRA_CODE\\n$JIRA_NUMBER" "$JIRA-label.png"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment