Created
October 5, 2023 20:48
-
-
Save jazlopez/af964e6b9593117d813c5e72d25802cf to your computer and use it in GitHub Desktop.
Crate JIRA Issue Python
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 os | |
from jira import JIRA | |
auth = { | |
'url': 'https://jira.amer.thermo.com/', | |
'user': os.getenv('JIRA_USER', ''), | |
'password': os.getenv('JIRA_PASSWORD', '') | |
} | |
issue_dict = { | |
'project': {'key': 'DHPB'}, | |
'summary': 'DELETEME-AUTOMATED CREATED ISSUE', | |
'description': 'DELETEME-AUTOMATED CREATED ISSUE.', | |
'issuetype': {'name': 'Task'}, | |
} | |
client = JIRA(auth['url'], auth=(auth['user'], auth['password']), max_retries=0) | |
issue = client.create_issue(fields=issue_dict) | |
issue_url = f"{auth['url']}/browse/{issue.key}" | |
print(f"Generated URL Jira Issue:{issue_url}") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment