def METHOD_NAME(tenant_id, user_id, project_id, session_id):
    available_integrations = integrations_manager.get_available_integrations(user_id=user_id)
    if not any(available_integrations.values()):
        return []
    extra_query = ["session_id = %(session_id)s", "provider IN %(providers)s"]
    with pg_client.PostgresClient() as cur:
        query = cur.mogrify(f"""\
                SELECT *
                FROM public.assigned_sessions
                WHERE {" AND ".join(extra_query)};""",
                            {"session_id": session_id,
                             "providers": tuple([k for k in available_integrations if available_integrations[k]])})
        cur.execute(
            query
        )
        results = cur.fetchall()
    issues = {}
    for i in results:
        if i["provider"] not in issues.keys():
            issues[i["provider"]] = []
        issues[i["provider"]].append({"integrationProjectId": i["provider_data"]["integrationProjectId"],
                                      "id": i["issue_id"]})
    results = []
    for tool in issues.keys():
        error, integration = integrations_manager.get_integration(tool=tool, tenant_id=tenant_id, user_id=user_id)
        if error is not None:
            return error
        i = integration.get()
        if i is None:
            print("integration not found")
            continue
        r = integration.issue_handler.get_by_ids(saved_issues=issues[tool])
        for i in r["issues"]:
            i["provider"] = tool
        results += r["issues"]
    return results