Created
June 9, 2020 09:54
-
-
Save bardal/ad607a0b9de6985176df2181752ac24b to your computer and use it in GitHub Desktop.
Sign into JIRA from Python using your browser's cookies
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
import jira | |
import urllib | |
import browser_cookie3 | |
def jira_login(jira_base_url): | |
hostname = urllib.parse.urlparse(jira_base_url).hostname | |
jira_cookies = browser_cookie3.chrome(domain_name=hostname) | |
cookie_dict= {c.name: c.value for c in jira_cookies} | |
options = {"server" : jira_base_url, "cookies" : cookie_dict} | |
return jira.JIRA(options) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment