File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ from jira import JIRA
2+ import os
3+
4+ def remove_before_minus (s ):
5+ return "jira-" + s .split ('-' )[1 ]
6+
7+ def add_prefix_to_each_line (s : str ):
8+ prefix = " "
9+ return prefix + prefix .join (s .splitlines (True ))
10+
11+ # curl -H "Authorization: Bearer ${JIRA_TOKEN}" -X GET ${JIRA_URL}/rest/api/2/myself | jq .
12+ jira = JIRA (server = os .getenv ('JIRA_URL' ),
13+ token_auth = os .getenv ('JIRA_TOKEN' ))
14+
15+ # ticket = jira.issue('IOO-6728')
16+ for ticket in jira .search_issues ('project = IVSOO AND status not in (Closed) AND text ~ "user-33" order by updated DESC' ):
17+ print ("##############################" )
18+ print (remove_before_minus (ticket .key ), ticket .fields .summary )
19+ print ("##############################" )
20+ comments = ticket .fields .comment .comments
21+ sorted (comments , key = lambda x : x .updated , reverse = True )
22+ for each_comment in comments :
23+ if each_comment .body .find ("user-33" ) != - 1 :
24+ print (f"{ each_comment .updated } - { each_comment .author .displayName } \n --- \n { add_prefix_to_each_line (each_comment .body )} \n --------------" )
Original file line number Diff line number Diff line change 1+ from jira import JIRA
2+ import os
3+
4+ def remove_before_minus (s ):
5+ return "jira-" + s .split ('-' )[1 ]
6+
7+ # curl -H "Authorization: Bearer ${JIRA_TOKEN}" -X GET ${JIRA_URL}/rest/api/2/myself | jq .
8+ jira = JIRA (server = os .getenv ('JIRA_URL' ),
9+ token_auth = os .getenv ('JIRA_TOKEN' ))
10+
11+ # ticket = jira.issue('IOO-6028')
12+ for ticket in jira .search_issues ('assignee = currentUser() AND resolution = Unresolved' ):
13+ print (f"{ remove_before_minus (ticket .key ):12} { ticket .fields .summary :<50} " )
You can’t perform that action at this time.
0 commit comments