Last active
February 5, 2021 15:56
-
-
Save russtaylor/61c0862bb8199c632d229701813592aa to your computer and use it in GitHub Desktop.
BitBar Script to display a Jira ticket in the menu bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Displays the current Ticket ID in the title bar, with options to | |
# copy to clipboard or go to the URL. | |
# | |
# echo 'PROJ-123' > ~/ticket.txt to update the ticket number, or | |
# create a bash alias/function to do so. | |
# | |
# I have the following bash function in my environment, so I can simply | |
# run `ticket PROJ-123` | |
# | |
# ticket () { | |
# echo $1 > ~/ticket.txt | |
# } | |
# | |
JIRA_URL=YOUR_JIRA_URL_HERE # Of the form https://jira.corp.com/browse/ | |
ticket=$(cat ~/ticket.txt) | |
function copyTicket() { | |
echo $ticket | tr -d '\n' | pbcopy | |
} | |
case "$1" in | |
"copy") | |
copyTicket | |
exit | |
;; | |
esac | |
echo "$ticket" | |
echo "---" | |
echo "Copy Ticket ID | bash=\"$0\" param1=copy terminal=false" | |
echo "On Jira|href='$JIRA_URL$ticket'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment