Models Reference

These are classes that model different types of JiraAPI resources that the application uses for implementing the different use cases.

Important

The attributes in these classes may not reflect the complete resource models supported by the Jira API. Classes only model the relevant attributes required y all the use cases supported by JiraTUI. These models can be extended or modified based on the needs of new or updated use cases. The design principle is to keep them as light as possible to avoid fetching unnecessary data from the API.

BaseModel

class BaseModel
as_dict() dict

Dumps dataclass into dictionary.

In this case some objects may be dumped differently e.g. Decimal will be dumped to a string.

as_json() dict

Dumps dataclass into json dictionary.

In this case some objects may be dumped differently eg. Decimal will be dumped to a string.

Project

class Project

Bases: jiratui.models.BaseModel

JiraIssueField

class JiraIssueField

Bases: jiratui.models.BaseModel

IssueStatus

class IssueStatus

Bases: jiratui.models.BaseModel

IssueType

class IssueType

Bases: jiratui.models.BaseModel

hierarchy_level: int | None

None

Hierarchy level of the issue type.

JiraUser

class JiraUser

Bases: jiratui.models.BaseModel

IssuePriority

class IssuePriority

Bases: jiratui.models.BaseModel

IssueComment

class IssueComment

Bases: jiratui.models.BaseModel

RelatedJiraIssue

class RelatedJiraIssue

Bases: jiratui.models.BaseModel

TimeTracking

class TimeTracking

Bases: jiratui.models.BaseModel

Attachment

class Attachment

Bases: jiratui.models.BaseModel

JiraSprint

class JiraSprint

Bases: jiratui.models.BaseModel

JiraBaseIssue

class JiraBaseIssue

Bases: jiratui.models.BaseModel

JiraIssuePickerSuggestion

class JiraIssuePickerSuggestion

Bases: jiratui.models.JiraBaseIssue

An issue returned by the API’s issue picker feature.

JiraIssueComponent

class JiraIssueComponent

Bases: jiratui.models.BaseModel

A component that can be associated to a work item.

JiraIssue

class JiraIssue

Bases: jiratui.models.JiraBaseIssue

edit_meta: dict | None

None

a dictionary with the issue’s edit metadata

custom_fields: dict[str, Any] | None

None

a dictionary with the value of the custom fields associated to the issue that support updates based on the issue’s edit metadata

additional_fields: dict[str, Any] | None

None

These are fields that are not custom but whose values are not stored in a specific field; like the ones above. These fields have a key without the prefix custom_ and, are rendered dynamically in the UI’s update form.

get_field_edit_metadata(name: str) dict | None

Retrieves the edit metadata for a field.

Parameters:

name – the name of a field.

Returns:

The metadata of the field; None if the metadata does not contain information of the field.

get_edit_metadata() dict | None

Retrieves the edit metadata for all the fields of the issue.

Returns:

The metadata of the fields associated to this issue that can be edited; None if no metadata is found.

get_custom_field_value(field_id: str) Any | None

Retrieves the value of a custom field.

Parameters:

field_id – the ID of a field.

Returns:

The value of the custom field.

get_additional_field_value(field_id: str) Any | None

Retrieves the value of a “dynamic” field.

Parameters:

field_id – the ID of a field.

Returns:

The value of the “dynamic” field.

JiraIssueSearchResponse

class JiraIssueSearchResponse

Bases: jiratui.models.BaseModel

JiraTimeTrackingConfiguration

class JiraTimeTrackingConfiguration

Bases: jiratui.models.BaseModel

JiraGlobalSettings

class JiraGlobalSettings

Bases: jiratui.models.BaseModel

JiraServerInfo

class JiraServerInfo

Bases: jiratui.models.BaseModel

JiraUserGroup

class JiraUserGroup

Bases: jiratui.models.BaseModel

JiraMyselfInfo

class JiraMyselfInfo

Bases: jiratui.models.BaseModel

UpdateIssueData

class UpdateIssueData

Bases: jiratui.models.BaseModel

UpdateWorkItemResponse

class UpdateWorkItemResponse

Bases: jiratui.models.BaseModel

IssueTransitionState

class IssueTransitionState

Bases: jiratui.models.BaseModel

IssueTransition

class IssueTransition

Bases: jiratui.models.BaseModel

LinkIssueType

class LinkIssueType

Bases: jiratui.models.BaseModel

JiraWorklog

class JiraWorklog

Bases: jiratui.models.BaseModel

comment: dict | str | None

None

Jira DC API uses strings instead of ADF, which are represented as dictionaries.

get_comment() str

Gets the value of the worklog’s comment.

Jira DC API uses strings instead of ADF. In these cases we simply return the string value. For Jira Cloud API the value of the comment is an ADF dictionary and, in these cases we need to convert it to Markdown.

Returns:

A string representation of the worklog’s description.

PaginatedJiraWorklog

class PaginatedJiraWorklog

Bases: jiratui.models.BaseModel

JiraField

class JiraField

Bases: jiratui.models.BaseModel

Represents a Jira field as returned by the endpoint that retrieves fields.

Also See: api-rest-api-3-field-get

id: str

None

The ID of the field.

key: str

None

The key of the field.

name: str

None

The name of the field.

custom: bool

None

Whether the field is a custom field.

untranslated_name: str | None

None

The name of the field without translations.

JQLAutocompleteSuggestion

class JQLAutocompleteSuggestion

Bases: jiratui.models.BaseModel

WorkItemsSearchOrderBy

class WorkItemsSearchOrderBy(*args, **kwds)

Bases: enum.Enum

Different modes to sort search results when searching for work items.

Initialization

CREATED_ASC

‘created asc’

Sort the work items by creation date in ascending order.

CREATED_DESC

‘created desc’

Sort the work items by creation date in descending order.

PRIORITY_ASC

‘priority asc’

Sort the work items by priority in ascending order.

PRIORITY_DESC

‘priority desc’

Sort the work items by priority in descending order.

KEY_ASC

‘key asc’

Sort the work items by key in ascending order.

KEY_DESC

‘key desc’

Sort the work items by key in descending order.