Add example JQL
This commit is contained in:
@@ -19,3 +19,16 @@ if user:
|
||||
print(f'Connected to JIRA as: {user}')
|
||||
else:
|
||||
print('Failed to connect to JIRA')
|
||||
|
||||
# Define a JQL query to fetch one JIRA ticket
|
||||
jql_query = 'created >= -30d order by created DESC' # Adjust the JQL query as needed
|
||||
max_results = 1 # Limit the results to one ticket
|
||||
|
||||
# Fetch the ticket(s) using the JQL query
|
||||
tickets = jira.jql(jql_query, limit=max_results)
|
||||
|
||||
if tickets and tickets.get('issues'):
|
||||
ticket = tickets['issues'][0]
|
||||
print(f"Fetched JIRA ticket: {ticket['key']} - {ticket['fields']['summary']}")
|
||||
else:
|
||||
print('No tickets found or failed to fetch tickets')
|
||||
Reference in New Issue
Block a user