Skip to content

Instantly share code, notes, and snippets.

@alpriest
Last active May 26, 2021 08:37
Show Gist options
  • Save alpriest/557f573dd3c0ac954649e9ae1861b2f3 to your computer and use it in GitHub Desktop.
Save alpriest/557f573dd3c0ac954649e9ae1861b2f3 to your computer and use it in GitHub Desktop.
How to setup Automator to open a Jira ticket from selected text
@alpriest
Copy link
Author

alpriest commented May 26, 2021

Create a new Automator Quick Action.
Set workflow receives current "text"
Add an ActionScript block and paste the below into it, adding your JIRA host name
Save the Automator task with a useful name e.g. "Open In Jira"

on run {input, parameters}	
	set target to "https://JIRA-HOST.COM/browse/" & (input as string)
	tell application "Safari"
			activate
			tell window 1
					set current tab to (make new tab with properties {URL:target})
			end tell
	end tell
end run

Open System Preferences
On the Security & Privacy tab under Accessibility, add Automator

On the Keyboard tab
Select Shortcuts
Select Services
Find your service in the list
Assign a keyboard shortcut, e,g. Option+Cmd+J

Open your favourite text editor and type a jira ticket number
From the app menu select Services, then Open In Jira
Now your keyboard shortcut should work everywhere (though it's a little tempremental)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment