Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
JIRA REST Client for Python - Atlassian Summit 2012
1.
2. JIRA REST Client for Python
Breaking free of Java’s velvet chains
Ben Speakmon
Developer Relations, Atlassian
3. How can I then return in happy plight,
That am debarr’d the benefit of REST?
Shakespeare (28.1-2)
(Updated for modern developers)
4. Why use a REST library?
• Turn JIRA into a service
• Integrate it with your other services or script against it
• Handles busywork for you
• Autotranslate from JSON to native objects and back
• Authentication, error handling, resource linking
• Support for Python, Java and Ruby
6. # Installing from source
# Like all good things, it lives on bitbucket
$ git clone https://bitbucket.org/
bspeakmon_atlassian/jira-python.git
# Manages dependencies and script installation
# for you
$ pip install jira-python
8. from jira.client import JIRA
options = {
'server': 'https://jira.atlassian.com'
}
jira = JIRA(options)
# Get an issue.
issue = jira.issue('JRA-1330')
# Find all comments made by Atlassians on this issue.
import re
atl_comments =
[comment for comment in issue.fields.comment.comments
if re.search(
r'@atlassian.com$', comment.author.emailAddress)]
9. # Update the assignee on an issue...
jira.assign_issue(issue, 'connie')
# ...or by editing the issue directly
issue.update(assignee='connie')
# Add a comment to an issue
jira.add_comment(issue, 'New comment body')
# Delete an issue
issue.delete()
11. An interactive JIRA shell (!)
• Treat your JIRA server like any other Python object
• Explore your issues, comments, workflows,
components as first-class resources
• Develop and test your scripts against your actual
server
• Test in production against real data
• Test bugfixes on staging
12.
13.
14. Want to play along?
• http://readthedocs.org/docs/jira-python/
• BSD licensed
• Pull requests already accepted
15. Use Python to turn your JIRA server into a powerful
web service! http://atlss.in/jira-python
#atlassiansummit
This slide can be used to break up the chapters of your talk - this would be the start to a new chapter\n- OR -\nThis could be used for making a single statement of a few words or a sentence.\n\nYou should choose one or the other, so that there’s a consistent system.\n
\n
\n
This slide can be used to break up the chapters of your talk - this would be the start to a new chapter\n- OR -\nThis could be used for making a single statement of a few words or a sentence.\n\nYou should choose one or the other, so that there’s a consistent system.\n
\n
\n
\n
\n
this can be used for key ideas that you want people to tweet\n