def fix_issue(issue_key): config = read_config() conn = get_conn(config) issue = get_issue_by_key(conn, issue_key) transition_issue(conn, issue, "Reopen Issue") transition_issue(conn, issue, "Start Progress") transition_issue(conn, issue, "Pull Request") transition_issue(conn, issue, "Ready For Deployment") transition_issue(conn, issue, "Deployed")
def advance(issue_key): config = read_config() conn = get_conn(config) issue = get_issue_by_key(conn, issue_key) result = advance_issue(conn, issue) if not result: msg = f"Failed to transition, issue still {issue.fields.status.name}" else: msg = f"Transitioned from {issue.fields.status.name} to {result}" click.echo(msg)
def add_epic_to_issue(issue_key, epic_key): config = read_config() conn = get_conn(config) issue = get_issue_by_key(conn, issue_key) try: epic_issue = get_issue_by_key(conn, epic_key) except Exception as e: click.echo(f"Could not find an epic with the key {epic_key}") try: associate_epic_to_issue(conn, issue, epic_issue) issue = get_issue_by_key(conn, issue_key) confirmed_epic_key = issue.fields.customfield_10910 click.echo(f"Added epic {confirmed_epic_key} to {issue_key}") except Exception as e: breakpoint() click.echo(f"Could not add epic {epic_key} to {issue_key}")
def edit(issue_key): config = read_config() conn = get_conn(config) edit_issue(conn, issue_key)
def print_fields_for(issue_key): config = read_config() conn = get_conn(config) issue = get_issue_by_key(conn, issue_key) print_issue_fields(issue)
def inspect(issue_key): config = read_config() conn = get_conn(config) issue = get_issue_by_key(conn, issue_key) breakpoint()
def get_issue(issue_key): config = read_config() conn = get_conn(config) issue = get_issue_by_key(conn, issue_key) print(get_printable_issue(issue, conn))
def mine(): config = read_config() conn = get_conn(config) for issue in get_open_issues(conn): issue_msg = get_printable_issue_brief(issue) click.echo(issue_msg)
def explore(): config = read_config() conn = get_conn(config) breakpoint()
def ls(status): config = read_config() conn = get_conn(config) for issue in get_issues_for_status(conn, status): click.echo(get_printable_issue_brief(issue))
def new(): config = read_config() conn = get_conn(config) new_issue = create_new_issue(conn, config) click.echo(new_issue)
def get_all_users(): config = read_config() conn = get_conn(config) for user in get_users(conn): click.echo(UserModel.from_API(user))
def epics_for_project(project_name): config = read_config() conn = get_conn(config) for e in get_all_epics(conn, project_name): click.echo(f"{e.fields.summary} ({e.key})")
def rm(issue_key): config = read_config() conn = get_conn(config) issue = get_issue_by_key(conn, issue_key) issue.delete()