def get_bamboo_plan_shortname(client, plan_id):
    """Get shortName of a Bamboo plan based on plan_id"""
    plan = client.get_plan(plan_id)
    if plan["shortName"]:
        plan_name = plan["shortName"]
    else:
        plan_name = plan["master"]["shortName"]
    return plan_name