Atlassian Summit – Recap
Atlassian Summit 2018
- Automate the Atlassian – The Lazy Admin’s Guide – 40 minute talk
- 5 Time Saving Tips Every Admin Needs to Know – 15 minute talk
In order to access Jira using OAuth token, we also need to create Jira Application link using public key that you have generated as a first step.
Jira provides rich set of REST APIs for user interaction through automation. One can authenticate with these REST APIs in three different ways: 1) Using Basic Auth 2) Cookie based Auth and 3) Using OAuth Token
It’s recommended one should use last two options specially with OAuth Token. In this tutorial we will learn how to generate OAuth token that you can use within your code.
Pr-requisite:
* Availability of OpenSSL command line
* Python 3
* Get Jira OAuth Generator library from Github
Couple of ways you can Access using Python.
1. Using Python Jira library (recommended):
Take a look at access_using_jira_library.py to find out how you can use OAuth with this library.
(jira_oauth1_py3_env) ➜ jira-oauth-generator git:(master) ✗ python access_using_jira_library.py config/final_oauth_token.config
Retrieving Issue: EXJIRA-123
Issue: EXJIRA-123, Summary: Deploy new JIRA Version
Retrieving 1st 3 Jira Projects available to you
First 3 Projects are [‘ABC’, ‘EDF’, ‘EXJIRA’]
2. Using bare bones Jira REST API along with Requests Library:
Take a look at access_using_requests_package.py to find out how you can use OAuth to access Jira with out box REST APIs.
(jira_oauth1_py3_env) ➜ jira-oauth-generator git:(master) ✗ python access_using_requests_package.py config/final_oauth_token.config
Retrieving 1st Jira Project available to you
(ABC) American Born Car
Adding comment to issue ABC-123
Comment successfully added. Please verify through browser!