gitea.issue
issue
Gitea Issue resource.
Classes
gitea.issue.AsyncIssue
Bases: BaseIssue, AsyncResource
Asynchronous Gitea Issue resource.
Source code in src/gitea/resource/async_resource.py
Methods:
gitea.issue.AsyncIssue.list_issues
async
list_issues(
owner: str,
repository: str,
state: Literal["closed", "open", "all"] | None = None,
labels: list[str] | None = None,
search_string: str | None = None,
issue_type: Literal["issues", "pulls"] | None = None,
milestones: list[str] | list[int] | None = None,
since: datetime | None = None,
before: datetime | None = None,
created_by: str | None = None,
assigned_by: str | None = None,
mentioned_by: str | None = None,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
List issues in a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
state
|
Literal['closed', 'open', 'all'] | None
|
Filter issues by state. |
None
|
labels
|
list[str] | None
|
Filter issues by labels. |
None
|
search_string
|
str | None
|
Filter issues by search string. |
None
|
issue_type
|
Literal['issues', 'pulls'] | None
|
Filter by issue type. |
None
|
milestones
|
list[str] | list[int] | None
|
Filter issues by milestones. |
None
|
since
|
datetime | None
|
Filter issues updated since this time. |
None
|
before
|
datetime | None
|
Filter issues updated before this time. |
None
|
created_by
|
str | None
|
Filter issues created by this user. |
None
|
assigned_by
|
str | None
|
Filter issues assigned to this user. |
None
|
mentioned_by
|
str | None
|
Filter issues mentioning this user. |
None
|
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of issues per page. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[list[dict[str, Any]], dict[str, Any]]
|
A tuple containing the list of issues as a list of dictionaries and the status code. |
Source code in src/gitea/issue/async_issue.py
gitea.issue.AsyncIssue.get_issue
async
get_issue(
owner: str, repository: str, index: int, **kwargs: Any
) -> tuple[dict[str, Any], dict[str, Any]]
Get a single issue by its index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
index
|
int
|
The index of the issue. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the issue as a dictionary and the status code. |
Source code in src/gitea/issue/async_issue.py
gitea.issue.AsyncIssue.edit_issue
async
edit_issue(
owner: str,
repository: str,
index: int,
assignee: str | None = None,
assignees: list[str] | None = None,
body: str | None = None,
due_date: datetime | None = None,
milestone: int | None = None,
ref: str | None = None,
state: Literal["closed", "open"] | None = None,
title: str | None = None,
unset_due_date: bool | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Edit a specific issue in a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
index
|
int
|
The index of the issue. |
required |
assignee
|
str | None
|
The new assignee of the issue. |
None
|
assignees
|
list[str] | None
|
The new assignees of the issue. |
None
|
body
|
str | None
|
The new body of the issue. |
None
|
due_date
|
datetime | None
|
The new due date of the issue. |
None
|
milestone
|
int | None
|
The new milestone of the issue. |
None
|
ref
|
str | None
|
The new reference of the issue. |
None
|
state
|
Literal['closed', 'open'] | None
|
The new state of the issue. |
None
|
title
|
str | None
|
The new title of the issue. |
None
|
unset_due_date
|
bool | None
|
Whether to unset the due date of the issue. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the edited issue as a dictionary and the status code. |
Source code in src/gitea/issue/async_issue.py
gitea.issue.AsyncIssue.create_issue
async
create_issue(
owner: str,
repository: str,
title: str,
assignee: str | None = None,
assignees: list[str] | None = None,
body: str | None = None,
closed: bool | None = None,
due_date: datetime | None = None,
labels: list[int] | None = None,
milestone: int | None = None,
ref: str | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Create an issue in a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
title
|
str
|
The title of the new issue. |
required |
assignee
|
str | None
|
The username to assign the issue to. |
None
|
assignees
|
list[str] | None
|
The usernames to assign the issue to. |
None
|
body
|
str | None
|
The body of the new issue. |
None
|
closed
|
bool | None
|
Whether the issue is created closed. |
None
|
due_date
|
datetime | None
|
The due date of the new issue. |
None
|
labels
|
list[int] | None
|
The label IDs to apply to the new issue. |
None
|
milestone
|
int | None
|
The milestone ID to associate with the new issue. |
None
|
ref
|
str | None
|
The reference of the new issue. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the created issue as a dictionary and a dictionary with metadata. |
Source code in src/gitea/issue/async_issue.py
gitea.issue.AsyncIssue.list_issue_dependencies
async
list_issue_dependencies(
owner: str,
repository: str,
index: int,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
List an issue's dependencies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
index
|
int
|
The index of the issue. |
required |
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of dependencies per page. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[list[dict[str, Any]], dict[str, Any]]
|
A tuple containing a list of dependency issues as dictionaries and a dictionary with metadata. |
Source code in src/gitea/issue/async_issue.py
gitea.issue.AsyncIssue.create_issue_dependency
async
create_issue_dependency(
owner: str,
repository: str,
index: int,
dependency_owner: str,
dependency_repository: str,
dependency_index: int,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Make an issue depend on another issue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
index
|
int
|
The index of the target issue. |
required |
dependency_owner
|
str
|
The owner of the dependency issue's repository. |
required |
dependency_repository
|
str
|
The name of the dependency issue's repository. |
required |
dependency_index
|
int
|
The index of the dependency issue. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the target issue as a dictionary and a dictionary with metadata. |
Source code in src/gitea/issue/async_issue.py
gitea.issue.AsyncIssue.remove_issue_dependency
async
remove_issue_dependency(
owner: str,
repository: str,
index: int,
dependency_owner: str,
dependency_repository: str,
dependency_index: int,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Remove an issue dependency.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
index
|
int
|
The index of the target issue. |
required |
dependency_owner
|
str
|
The owner of the dependency issue's repository. |
required |
dependency_repository
|
str
|
The name of the dependency issue's repository. |
required |
dependency_index
|
int
|
The index of the dependency issue. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the target issue as a dictionary and a dictionary with metadata. |
Source code in src/gitea/issue/async_issue.py
gitea.issue.Issue
Gitea Issue resource.
Source code in src/gitea/resource/resource.py
Methods:
gitea.issue.Issue.list_issues
list_issues(
owner: str,
repository: str,
state: Literal["closed", "open", "all"] | None = None,
labels: list[str] | None = None,
search_string: str | None = None,
issue_type: Literal["issues", "pulls"] | None = None,
milestones: list[str] | list[int] | None = None,
since: datetime | None = None,
before: datetime | None = None,
created_by: str | None = None,
assigned_by: str | None = None,
mentioned_by: str | None = None,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
List issues in a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
state
|
Literal['closed', 'open', 'all'] | None
|
Filter issues by state. |
None
|
labels
|
list[str] | None
|
Filter issues by labels. |
None
|
search_string
|
str | None
|
Filter issues by search string. |
None
|
issue_type
|
Literal['issues', 'pulls'] | None
|
Filter by issue type. |
None
|
milestones
|
list[str] | list[int] | None
|
Filter issues by milestones. |
None
|
since
|
datetime | None
|
Filter issues updated since this time. |
None
|
before
|
datetime | None
|
Filter issues updated before this time. |
None
|
created_by
|
str | None
|
Filter issues created by this user. |
None
|
assigned_by
|
str | None
|
Filter issues assigned to this user. |
None
|
mentioned_by
|
str | None
|
Filter issues mentioning this user. |
None
|
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of issues per page. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[list[dict[str, Any]], dict[str, Any]]
|
A tuple containing a list of issues as dictionaries and a dictionary with metadata. |
Source code in src/gitea/issue/issue.py
gitea.issue.Issue.get_issue
get_issue(
owner: str, repository: str, index: int, **kwargs: Any
) -> tuple[dict[str, Any], dict[str, Any]]
Get a single issue by its index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
index
|
int
|
The index of the issue. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the issue as a dictionary and a dictionary with metadata. |
Source code in src/gitea/issue/issue.py
gitea.issue.Issue.edit_issue
edit_issue(
owner: str,
repository: str,
index: int,
assignee: str | None = None,
assignees: list[str] | None = None,
body: str | None = None,
due_date: datetime | None = None,
milestone: int | None = None,
ref: str | None = None,
state: Literal["closed", "open"] | None = None,
title: str | None = None,
unset_due_date: bool | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Edit a specific issue in a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
index
|
int
|
The index of the issue. |
required |
assignee
|
str | None
|
The new assignee of the issue. |
None
|
assignees
|
list[str] | None
|
The new assignees of the issue. |
None
|
body
|
str | None
|
The new body of the issue. |
None
|
due_date
|
datetime | None
|
The new due date of the issue. |
None
|
milestone
|
int | None
|
The new milestone of the issue. |
None
|
ref
|
str | None
|
The new reference of the issue. |
None
|
state
|
Literal['closed', 'open'] | None
|
The new state of the issue. |
None
|
title
|
str | None
|
The new title of the issue. |
None
|
unset_due_date
|
bool | None
|
Whether to unset the due date of the issue. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the updated issue as a dictionary and a dictionary with metadata. |
Source code in src/gitea/issue/issue.py
gitea.issue.Issue.create_issue
create_issue(
owner: str,
repository: str,
title: str,
assignee: str | None = None,
assignees: list[str] | None = None,
body: str | None = None,
closed: bool | None = None,
due_date: datetime | None = None,
labels: list[int] | None = None,
milestone: int | None = None,
ref: str | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Create an issue in a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
title
|
str
|
The title of the new issue. |
required |
assignee
|
str | None
|
The username to assign the issue to. |
None
|
assignees
|
list[str] | None
|
The usernames to assign the issue to. |
None
|
body
|
str | None
|
The body of the new issue. |
None
|
closed
|
bool | None
|
Whether the issue is created closed. |
None
|
due_date
|
datetime | None
|
The due date of the new issue. |
None
|
labels
|
list[int] | None
|
The label IDs to apply to the new issue. |
None
|
milestone
|
int | None
|
The milestone ID to associate with the new issue. |
None
|
ref
|
str | None
|
The reference of the new issue. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the created issue as a dictionary and a dictionary with metadata. |
Source code in src/gitea/issue/issue.py
gitea.issue.Issue.list_issue_dependencies
list_issue_dependencies(
owner: str,
repository: str,
index: int,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
List an issue's dependencies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
index
|
int
|
The index of the issue. |
required |
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of dependencies per page. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[list[dict[str, Any]], dict[str, Any]]
|
A tuple containing a list of dependency issues as dictionaries and a dictionary with metadata. |
Source code in src/gitea/issue/issue.py
gitea.issue.Issue.create_issue_dependency
create_issue_dependency(
owner: str,
repository: str,
index: int,
dependency_owner: str,
dependency_repository: str,
dependency_index: int,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Make an issue depend on another issue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
index
|
int
|
The index of the target issue. |
required |
dependency_owner
|
str
|
The owner of the dependency issue's repository. |
required |
dependency_repository
|
str
|
The name of the dependency issue's repository. |
required |
dependency_index
|
int
|
The index of the dependency issue. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the target issue as a dictionary and a dictionary with metadata. |
Source code in src/gitea/issue/issue.py
gitea.issue.Issue.remove_issue_dependency
remove_issue_dependency(
owner: str,
repository: str,
index: int,
dependency_owner: str,
dependency_repository: str,
dependency_index: int,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Remove an issue dependency.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
index
|
int
|
The index of the target issue. |
required |
dependency_owner
|
str
|
The owner of the dependency issue's repository. |
required |
dependency_repository
|
str
|
The name of the dependency issue's repository. |
required |
dependency_index
|
int
|
The index of the dependency issue. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the target issue as a dictionary and a dictionary with metadata. |
Source code in src/gitea/issue/issue.py
Functions:
gitea.issue.async_column_holds_card
async
async_column_holds_card(
*,
client: AsyncGitea,
owner: str,
repository: str | None,
project_id: int,
column_id: int,
issue_id: int,
) -> bool
Report whether one column of a project holds an issue's card.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
AsyncGitea
|
The asynchronous Gitea client used for the lookup. |
required |
owner
|
str
|
The owner of the repository or organization holding the project. |
required |
repository
|
str | None
|
The name of the repository holding the project, or None for an organization project. |
required |
project_id
|
int
|
The ID of the project. |
required |
column_id
|
int
|
The ID of the column. |
required |
issue_id
|
int
|
The global ID of the issue. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True when a card for the issue is in that column. |
Source code in src/gitea/issue/project_column.py
gitea.issue.column_holds_card
column_holds_card(
*,
client: Gitea,
owner: str,
repository: str | None,
project_id: int,
column_id: int,
issue_id: int,
) -> bool
Report whether one column of a project holds an issue's card.
The single column the board walk above asks about, asked on its own: a caller that already knows which column it means - one confirming a card arrived where it was sent - pays for that column's listing rather than the board's.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
Gitea
|
The Gitea client used for the lookup. |
required |
owner
|
str
|
The owner of the repository or organization holding the project. |
required |
repository
|
str | None
|
The name of the repository holding the project, or None for an organization project. |
required |
project_id
|
int
|
The ID of the project. |
required |
column_id
|
int
|
The ID of the column. |
required |
issue_id
|
int
|
The global ID of the issue. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True when a card for the issue is in that column. |
Source code in src/gitea/issue/project_column.py
gitea.issue.find_async_card_column_id
async
find_async_card_column_id(
*,
client: AsyncGitea,
owner: str,
repository: str | None,
project_id: int,
issue_id: int,
) -> int | None
Find the column of a project that lists an issue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
AsyncGitea
|
The asynchronous Gitea client used for the lookups. |
required |
owner
|
str
|
The owner of the repository or organization holding the project. |
required |
repository
|
str | None
|
The name of the repository holding the project, or None for an organization project. |
required |
project_id
|
int
|
The ID of the project. |
required |
issue_id
|
int
|
The global ID of the issue. |
required |
Returns:
| Type | Description |
|---|---|
int | None
|
The ID of the column listing the issue, or None when no column of the |
int | None
|
project lists it. |
Source code in src/gitea/issue/project_column.py
gitea.issue.find_card_column_id
find_card_column_id(
*,
client: Gitea,
owner: str,
repository: str | None,
project_id: int,
issue_id: int,
) -> int | None
Find the column of a project that lists an issue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
Gitea
|
The Gitea client used for the lookups. |
required |
owner
|
str
|
The owner of the repository or organization holding the project. |
required |
repository
|
str | None
|
The name of the repository holding the project, or None for an organization project. |
required |
project_id
|
int
|
The ID of the project. |
required |
issue_id
|
int
|
The global ID of the issue. |
required |
Returns:
| Type | Description |
|---|---|
int | None
|
The ID of the column listing the issue, or None when no column of the |
int | None
|
project lists it. |
Source code in src/gitea/issue/project_column.py
gitea.issue.resolve_async_project_column_ids
async
resolve_async_project_column_ids(
*,
client: AsyncGitea,
owner: str,
repository: str,
issue: dict[str, Any],
) -> dict[str, Any]
Populate the column_id of every project an issue is on.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
AsyncGitea
|
The asynchronous Gitea client used for the lookups. |
required |
owner
|
str
|
The owner of the repository holding the issue. |
required |
repository
|
str
|
The name of the repository holding the issue. |
required |
issue
|
dict[str, Any]
|
The issue data returned by the API. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The issue data with a |
dict[str, Any]
|
column the issue's card sits in, or None when it has no card there and |
dict[str, Any]
|
when the lookup could not be made or failed. The issue is returned |
dict[str, Any]
|
unchanged when it lists no projects. |
Source code in src/gitea/issue/project_column.py
gitea.issue.resolve_project_column_ids
resolve_project_column_ids(
*,
client: Gitea,
owner: str,
repository: str,
issue: dict[str, Any],
) -> dict[str, Any]
Populate the column_id of every project an issue is on.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
Gitea
|
The Gitea client used for the lookups. |
required |
owner
|
str
|
The owner of the repository holding the issue. |
required |
repository
|
str
|
The name of the repository holding the issue. |
required |
issue
|
dict[str, Any]
|
The issue data returned by the API. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The issue data with a |
dict[str, Any]
|
column the issue's card sits in, or None when it has no card there and |
dict[str, Any]
|
when the lookup could not be made or failed. The issue is returned |
dict[str, Any]
|
unchanged when it lists no projects. |