Skip to content

Instantly share code, notes, and snippets.

@bardal
Created June 9, 2020 09:54
Show Gist options
  • Save bardal/ad607a0b9de6985176df2181752ac24b to your computer and use it in GitHub Desktop.
Save bardal/ad607a0b9de6985176df2181752ac24b to your computer and use it in GitHub Desktop.
Sign into JIRA from Python using your browser's cookies
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