Skip to content

Instantly share code, notes, and snippets.

@seta-phucpham
Last active February 29, 2024 09:56
Show Gist options
  • Save seta-phucpham/a8b911ca6d7f0755fb243658f6f5c5d1 to your computer and use it in GitHub Desktop.
Save seta-phucpham/a8b911ca6d7f0755fb243658f6f5c5d1 to your computer and use it in GitHub Desktop.
autogen report
# against jira.atlassian.com.
from __future__ import annotations
from jira import JIRA
from enum import Enum
from typing import DefaultDict, List
from collections import defaultdict
BASE_URL = "https://jira.seta-international.vn"
TOKEN = "<YOUR_JIRA_TOKEN>"
RECENT_TASK_JQL = 'assignee = currentUser() AND (status = "In Progress" OR (status = "Dev Done" AND updated >= -1d)) AND Sprint in openSprints() ORDER BY updated DESC'
MAX_RESULTS = 50
class IssueStatus(str, Enum):
Todo = "To Do"
DevDone = "Dev Done"
InProgress = "In Progress"
Staging = "Staging"
Blocked = "Blocked"
reported_status: List[IssueStatus] = [
IssueStatus.Blocked,
IssueStatus.DevDone,
IssueStatus.InProgress,
]
reported_issued: DefaultDict[str, List[str]] = defaultdict(list)
jira = JIRA(server=BASE_URL, token_auth=TOKEN)
for issue in jira.search_issues(RECENT_TASK_JQL, maxResults=MAX_RESULTS):
reported_issued[issue.fields.status.name].append(
f"{issue.key}: {issue.fields.summary}"
)
for status, issues in reported_issued.items():
if status not in reported_status:
continue
report_message = f"## {status}\n\n"
for issue in issues:
report_message += f"- {issue}\n"
print(report_message)
## Dev Done
- ERP-455: Add tooltips cho buttons tại các màn Goal và Voice
## In Progress
- ERP-457: [FE] Convert message strings to error code for attachment module
- ERP-265: [BE] Convert message strings to errorCode
- ERP-289: Convert message string to error code for session and attachment module
- ERP-269: Convert message string to error code for auth module
- ERP-443: [BE] Update employee API related to voice managements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment