Hey everyone, I’m stuck with a Python script I made to create Jira tickets automatically. It’s giving me a headache!
The script runs on Ubuntu with Python 3.6 and 3.7. Here’s what it looks like:
def create_ticket_info(sprint, user_id, other_stuff):
return {
'fields': {
'project': {'key': 'MAIN'},
'summary': f'Query: {user_id}',
'description': 'Ticket details go here',
'issuetype': {'name': 'Issue'},
'Epic Link': 'MAIN-100',
'Sprint': sprint,
'assignee': 'coolDev'
}
}
ticket_data = create_ticket_info(sprint, user_id, other_stuff)
jira_connection.create_issue(fields=ticket_data)
But when I run it, I get this error:
KeyError: 'project'
It’s saying it can’t find the ‘project’ key, even though I clearly included it in the dictionary. I expected it to work smoothly and file the tickets. Any ideas on what’s going wrong?