Python scripts to help improve Atlassian Jira interactions.
While designed for the iOS Pythonista application, the scripts runs on any linux/mac os environment.
Extract Jira ID from clipboard or shared text or command line arg, and then output summary info for that jira ticket instantly.
Extract Jira ID from clipboard or shared text or command line arg, and launch a browser with the URL to the Jira issue.
Uses the clipboard, or prompts for a Jira Query and launches a browser window.
- Download or clone the github repo, or:
- Pythonista console:
import urllib2; exec urllib2.urlopen('http://khl.io/jira-py').read()
- Linux/Mac OS Terminal:
python -c "import urllib2; exec urllib2.urlopen('http://khl.io/jira-py').read()"
- Pythonista console:
- Rename
jira.sample.conf
tojira.conf
and update values
iOS / Pythonista
- In any app, use App Share, Run in Pythonista and then select this script.
- Copy text with a Jira ID in it, and run this script in Pythonista.
Linux/Mac OS
- Run this script in a linux/os x terminal with the JIRA ID as a command line arg
- eg.
python jira.py ST-1222
- eg.
- Launch
/Applications/Automator
- Create a new document of type Service
- Save as something indicator, eg
jira-id
(be a bit more creative)- The script will be saved to
/Users/USERNAME/Library/Services/jira-id.workflow
- The script will be saved to
- Configure (top ot the screen) to be: Service recieves selected
text
inany application
- Save as something indicator, eg
- Add the following workflow actions
- Prompt for text (Optional) -
Utilities
/Run JavaScript
- Prompt for text (Optional) -
function run(input, parameters) {
// https://github.com/dtinth/JXA-Cookbook/wiki
var app = Application.currentApplication()
app.includeStandardAdditions = true
var ans = app.displayDialog('Enter Jira Search', {defaultAnswer: '' + input} ).textReturned
return ans;
}
- Pick one of the options below - 1 - **Extract Jira ID** - `Utilities` / `Run JavaScript`
javascript
function run(input, parameters) {
var re = new RegExp('([a-zA-Z]+-[0-9]+)');
var items = re.exec(input);
if (!items) {
return input;
} else {
return 'https://jira.com/browse/' + items[0];
}
return input;
}
- 2 - **Perform a Jira JQL Search** - `Utilities` / `Run JavaScript`
javascript
function run(input, parameters) {
return 'https://jira.nationalgeographic.com/issues/?jql=' + input;
}
```
- Launch the default browser - Internet
/ `Display Webpages`
- Setup Keyboard Shortcut
- Launch
System Preferences
and navigate toKeyboard
/Shortcuts
- Under
Services
locate your Service in theText
category - Assign a keyboard shortcut.
- Launch