Jira Weekly Summary
import logging
import requests
from datetime import datetime, timedelta
import json
from pprint import pprint
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.WARNING)
def format_ticket(ticket):
formatted_ticket = {
"Ticket ID": ticket['id'],
"Key": ticket['key'],
"Summary": ticket['fields']['summary'],
"Status": ticket['fields']['status']['name'],
"Type": ticket['fields']['issuetype']['name'],
"Priority": ticket['fields']['priority']['name'],
"Assignee": ticket['fields']['assignee']['displayName'] if ticket['fields']['assignee'] else "Unassigned",
"Updated": ticket['fields']['updated'],
"Project": ticket['fields']['project']['name'],
}
return formatted_ticket
Frequently Asked Questions
How can the Jira Weekly Summary app benefit project managers?
The Jira Weekly Summary app provides project managers with a quick and easy way to review completed tasks for the week. This can help in tracking progress, identifying productive team members, and preparing for status meetings or reports. By automating the process of gathering this information, the app saves time and ensures consistent reporting of completed work across projects.
Can the Jira Weekly Summary app be customized to show different ticket statuses or time ranges?
While the current version of the Jira Weekly Summary app focuses on 'Done' tickets within the current week, it can be customized to show different statuses or time ranges. This would involve modifying the jql_query
variable in the get_closed_tickets
function. For example, to show tickets in progress for the last month, you could change the query to:
python
jql_query = 'status = "In Progress" AND updated >= startOfMonth(-1) AND updated <= endOfMonth() order by created DESC'
Remember to also update the function name and any related comments for clarity.
How does the Jira Weekly Summary app handle data security and user authentication?
The Jira Weekly Summary app prioritizes data security by using API tokens for authentication instead of passwords. It prompts users to input their Jira domain, email, and API token at runtime, rather than storing these credentials in the code. This approach ensures that sensitive information is not hardcoded or accidentally shared. The app uses HTTPS for API requests, providing encrypted communication with Jira servers.
Can the Jira Weekly Summary app be integrated into a larger reporting system?
Yes, the Jira Weekly Summary app can be integrated into a larger reporting system. Its modular design allows for easy incorporation into other Python scripts or applications. For instance, you could modify the main
function to return the formatted tickets instead of printing them:
python
def main():
try:
jira_domain, email, api_token = get_jira_credentials()
closed_tickets = get_closed_tickets(jira_domain, email, api_token)
return [format_ticket(ticket) for ticket in closed_tickets]
except EnvironmentError as e:
logger.error(e)
return []
This would allow other parts of your reporting system to use the data as needed.
How can I extend the Jira Weekly Summary app to include additional ticket information?
The Jira Weekly Summary app can be easily extended to include additional ticket information by modifying the format_ticket
function. For example, if you wanted to include the ticket description and creation date, you could update the function like this:
python
def format_ticket(ticket):
formatted_ticket = {
"Ticket ID": ticket['id'],
"Key": ticket['key'],
"Summary": ticket['fields']['summary'],
"Description": ticket['fields']['description'],
"Created": ticket['fields']['created'],
"Status": ticket['fields']['status']['name'],
"Type": ticket['fields']['issuetype']['name'],
"Priority": ticket['fields']['priority']['name'],
"Assignee": ticket['fields']['assignee']['displayName'] if ticket['fields']['assignee'] else "Unassigned",
"Updated": ticket['fields']['updated'],
"Project": ticket['fields']['project']['name'],
}
return formatted_ticket
This flexibility allows you to customize the Jira Weekly Summary app to fit your specific reporting needs.
Created: | Last Updated:
Introduction to the Jira Weekly Summary Template
Welcome to the step-by-step guide on how to use the Jira Weekly Summary template. This template is designed to help you generate a report of all completed Jira tasks within the past week. It will request your Jira domain, email, and API token to access the Jira API and retrieve a list of closed tickets with the status 'Done' that were updated between the start and end of the current week. To get started, simply click "Start with this Template" on the Lazy platform.
External Integrations
Before you can use this template, you need to ensure that you have the following:
- A Jira account with access to the projects you wish to report on.
- An API token from Jira which will be used for authentication. You can generate an API token by following the instructions provided in the Atlassian documentation.
Once you have these details, you will be ready to proceed with using the template.
Using the Test Button and Providing User Input
After clicking "Start with this Template," you will use the Test button to begin the deployment of the app. The Lazy CLI will launch, and you will be prompted to enter the required user input:
- Your Jira domain (e.g., "yourcompany" if your Jira instance is "yourcompany.atlassian.net").
- Your email associated with your Jira account.
- Your Jira API token.
Once you have provided this information, the template will interact with the Jira API to fetch the closed tickets and display them in a formatted manner.
Sample Request and Response
While the template itself does not directly expose an API endpoint, it does make requests to the Jira API. Here is an example of what the request and response might look like:
Sample Request:
This is handled internally by the template, but it essentially performs a GET request to the Jira API with a JQL query to fetch closed tickets.
Sample Response:
The response will be a JSON object containing the details of the closed tickets, which the template will then format and print out. Here's an example of what a single ticket might look like in the output:
```
{ "Ticket ID": "10001", "Key": "PROJ-1", "Summary": "Fix login bug", "Status": "Done", "Type": "Bug", "Priority": "High", "Assignee": "Jane Doe", "Updated": "2023-03-01T12:00:00.000+0000", "Project": "Project Name" }
```
Remember, you do not need to manually make these requests or handle the responses; the template will do this for you once you provide the necessary Jira credentials.
Conclusion
By following these steps, you will be able to use the Jira Weekly Summary template to generate a report of completed tasks in your Jira projects. This tool is designed to simplify your workflow and provide you with valuable insights into your team's progress over the week. If you encounter any issues or have further questions, please reach out for support through the Lazy platform.
Template Benefits
-
Improved Project Visibility: This template provides a quick and easy way to generate weekly summaries of completed Jira tasks, giving project managers and team leads a clear overview of progress and accomplishments.
-
Time-Saving Automation: By automating the process of gathering and formatting closed ticket information, this template saves valuable time that would otherwise be spent manually compiling reports.
-
Enhanced Accountability: Regular summaries of completed tasks help keep team members accountable and provide a tangible record of individual and team productivity.
-
Data-Driven Decision Making: With easy access to weekly completion data, managers can make more informed decisions about resource allocation, workload balancing, and project timelines.
-
Streamlined Communication: The formatted output of closed tickets can be easily shared with stakeholders, clients, or team members, facilitating clear and concise communication about project progress and milestones achieved.