Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Receiving error when trying to use jira.create_issue

Mont
Contributor
May 5, 2023

Hello,

I'm trying to make an API call to JIRAs API to create a new issue. I followed the instructions in documentation and created jira_client to call the API to create_issue; however, I am receiving a very vague error just indicating an HTTP Cleint Error.

There's no username used from what I know or required in test environment I'm running on.

Does anyone know what could possibly cause these errors or a way to troubleshoot to determine the cause?

HTTPError: 400 Client Error: for url: https://jira.<domain_name>.com/jiradp/rest/api/2/issue?updateHistory=false

Here's my sample code

# Call JIRA to create ticket
from atlassian import Jira, errors

def get_jira():
    jira_client = Jira(
    url='https://jira.<domainname>.com/jiradp',
    #username=settings.jira_username,
    #password=settings.jira_api_key,
    cloud=False
     )
    return jira_client


jira_client = get_jira()

issue_dict = {
    "project": {
    "id": '2',
    "summary": 'test summary',
    "description": f'New issue for Me',
    "componenets": [{'Remediation': 'Test',
    'AWS Documentation': 'Test Document'}],
    "reporter": {"name": "101"},
    "issuetype": {"name": "11500"},
    "priority": {
        "name": "CRITICAL"
     }
     }}

2 answers

1 accepted

2 votes
Answer accepted
Mont
Contributor
May 5, 2023 edited

Looks like I was missing a curly bracket at end of project id

Lorien Anderson August 15, 2023

Untrue. I pasted issue_dict into python and it's a normal dict.

Lorien Anderson August 15, 2023

There must be some other reason this was failing... 

0 votes
Lorien Anderson August 15, 2023

I'm having the same issue. Any insights would be appreciated!

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Upcoming Jira Events