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

A base model that provides serialization and deserialization of methods.

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

A Jira project.

IssueStatus

class IssueStatus

Bases: jiratui.models.BaseModel

The status of a work item.

IssueType

class IssueType

Bases: jiratui.models.BaseModel

The type of work item.

hierarchy_level: int | None

None

Hierarchy level of the issue type.

scope_project: jiratui.models.Project | None

None

The Project that serves as scope of this type of work items.

JiraUser

class JiraUser

Bases: jiratui.models.BaseModel

A user who can log in to Jira.

IssuePriority

class IssuePriority

Bases: jiratui.models.BaseModel

The priority of work item.

IssueComment

class IssueComment

Bases: jiratui.models.BaseModel

A comment associated to a work item.

author: jiratui.models.JiraUser

None

The JiraUser author of the comment.

update_author: jiratui.models.JiraUser | None

None

The JiraUser that last updated the comment.

RelatedJiraIssue

class RelatedJiraIssue

Bases: jiratui.models.BaseModel

A work item that is related to another one via a link.

status: jiratui.models.IssueStatus

None

The IssueStatus of the work item.

issue_type: jiratui.models.IssueType

None

The IssueType of the work item.

priority: jiratui.models.IssuePriority | None

None

The IssuePriority of the work item.

TimeTracking

class TimeTracking

Bases: jiratui.models.BaseModel

Attachment

class Attachment

Bases: jiratui.models.BaseModel

author: jiratui.models.JiraUser | None

None

The JiraUser author of this attachment.

JiraSprint

class JiraSprint

Bases: jiratui.models.BaseModel

The sprint of a work item.

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

status: jiratui.models.IssueStatus

None

The IssueStatus of the work item.

project: jiratui.models.Project | None

None

The Project of the work item.

reporter: jiratui.models.JiraUser | None

None

The JiraUser that reported the work item.

issue_type: jiratui.models.IssueType | None

None

The IssueType of the work item.

priority: jiratui.models.IssuePriority | None

None

The IssuePriority of the work item.

assignee: jiratui.models.JiraUser | None

None

The JiraUser that is assigned to the work item.

comments: list[jiratui.models.IssueComment] | None

None

The list of IssueComment of the work item.

related_issues: list[jiratui.models.RelatedJiraIssue] | None

None

The list of RelatedJiraIssue of the work item.

attachments: list[jiratui.models.Attachment] | None

None

The list of files Attachment of the work item.

sprint: jiratui.models.JiraSprint | None

None

The JiraSprint of the work item.

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.

components: list[jiratui.models.JiraIssueComponent] | None

None

The list of JiraIssueComponent of the work item.

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

The global settings of the Jira server the application connects to.

JiraServerInfo

class JiraServerInfo

Bases: jiratui.models.BaseModel

Information of the Jira server the application connects to.

JiraUserGroup

class JiraUserGroup

Bases: jiratui.models.BaseModel

A Jira group of users.

JiraMyselfInfo

class JiraMyselfInfo

Bases: jiratui.models.BaseModel

Information of the user connected to the Jira server used by the application.

groups: list[jiratui.models.JiraUserGroup] | None

None

A list of JiraUserGroup describing the user groups a user belongs to.

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

A type of link that relates 2 work items.

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.

See Also:

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.