open-swe/agent/tools/linear_create_issue.py
Brace Sproul 91348aeb7c
feat: add linear tools for listing teams, get/create/update/delete issues, and get issue comments (#1105)
Adds 6 new agent tools backed by Linear's GraphQL API, with a shared
_graphql_request helper to reduce boilerplate. Refactors existing
comment_on_linear_issue to use the same helper.

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-03-23 14:32:44 -07:00

43 lines
1.2 KiB
Python

import asyncio
from typing import Any
from ..utils.linear import create_issue
def linear_create_issue(
team_id: str,
title: str,
description: str | None = None,
assignee_id: str | None = None,
priority: int | None = None,
state_id: str | None = None,
label_ids: list[str] | None = None,
project_id: str | None = None,
) -> dict[str, Any]:
"""Create a new Linear issue.
Args:
team_id: The ID of the team to create the issue in.
title: The title of the issue.
description: Optional markdown description.
assignee_id: Optional user ID to assign the issue to.
priority: Optional priority (0=none, 1=urgent, 2=high, 3=medium, 4=low).
state_id: Optional workflow state ID.
label_ids: Optional list of label IDs to apply.
project_id: Optional project ID to associate with.
Returns:
Dictionary with 'success' bool and 'issue' details.
"""
return asyncio.run(
create_issue(
team_id=team_id,
title=title,
description=description,
assignee_id=assignee_id,
priority=priority,
state_id=state_id,
label_ids=label_ids,
project_id=project_id,
)
)