| 219 | |
| 220 | |
| 221 | def format_issue_output(issue_type, issue_id, status, |
| 222 | summary, assignee, components): |
| 223 | if not assignee: |
| 224 | assignee = "NOT ASSIGNED!!!" |
| 225 | else: |
| 226 | assignee = getattr(assignee, "displayName", assignee) |
| 227 | |
| 228 | if len(components) == 0: |
| 229 | components = 'NO COMPONENTS!!!' |
| 230 | else: |
| 231 | components = ', '.join((getattr(x, "name", x) for x in components)) |
| 232 | |
| 233 | url_id = issue_id |
| 234 | if "GH" in issue_id: |
| 235 | url_id = issue_id.replace("GH-", "") |
| 236 | |
| 237 | url = f'https://github.com/{ORG_NAME}/{PROJECT_NAME}/issues/{url_id}' |
| 238 | |
| 239 | return f"""=== {issue_type.upper()} {issue_id} === |
| 240 | Summary\t\t{summary} |
| 241 | Assignee\t{assignee} |
| 242 | Components\t{components} |
| 243 | Status\t\t{status} |
| 244 | URL\t\t{url}""" |
| 245 | |
| 246 | |
| 247 | class GitHubAPI(object): |