Created
March 1, 2024 18:00
-
-
Save scoheb/5db9860215a0c461414b36726775484c to your computer and use it in GitHub Desktop.
get status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import textwrap | |
from smtplib import SMTP | |
import jira | |
from common import backlog_managers, search, send_mail, unique | |
query = """ | |
"Parent Link" = RHTAP-990 AND status != Closed ORDER BY key DESC | |
""".strip( | |
"\n" | |
) | |
if __name__ == "__main__": | |
url = os.environ.get("JIRA_URL", "https://issues.redhat.com") | |
token = os.environ.get("JIRA_TOKEN") | |
if not token: | |
raise KeyError( | |
"Set JIRA_TOKEN environment variable to your JIRA personal access token" | |
) | |
client = jira.client.JIRA(server=url, token_auth=token) | |
fields = dict([(f["name"], f["id"]) for f in client.fields()]) | |
issues = search(client, query) | |
for issue in issues: | |
query = f'("Parent Link" = {issue.key} OR "Epic Link" = {issue.key}) ORDER BY key DESC'.strip("\n") | |
childIssues = search(client, query) | |
print(issue.key, issue.fields.summary, issue.fields.assignee, issue.fields.status, sep=",") | |
comments = issue.fields.comment.comments | |
if comments: | |
comment = comments[-1] | |
print("Last Feature Comment") | |
print("text: ", comment.body) | |
print("author: ", comment.author.displayName) | |
print("time: ", comment.created) | |
for child in childIssues: | |
print("child", child.key, child.fields.summary, child.fields.assignee, child.fields.status, sep=",") | |
childComments = child.fields.comment.comments | |
if childComments: | |
childComment = childComments[-1] | |
print("Last Epic Comment") | |
print("text: ", childComment.body) | |
print("author: ", childComment.author.displayName) | |
print("time: ", childComment.created) | |
print("") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment