Add type-safe Jira issue models with fluent builders#1
Merged
yechielb2000 merged 1 commit intomasterfrom Apr 12, 2026
Merged
Conversation
Introduce a new `atlassian.models.jira` package that eliminates manual JSON/dictionary construction for Jira operations in favor of typed dataclasses, fluent builders, and a centralized serializer. Core modules: - fields.py: frozen value-object dataclasses (Project, Priority, User, etc.) with to_dict()/from_dict() for (de)serialization - issues.py: JiraIssue base + Task/Bug/Story/Epic/SubTask with __init_subclass__ auto-registry - builders.py: generic IssueBuilder[T] with per-type builders, ADF bridge pattern, and .validate() chaining - serializer.py: FieldMapping + serialize()/to_fields_dict()/bulk_serialize() - adf.py: ADFBuilder for Atlassian Document Format rich-text descriptions - validation.py: pre-flight validate()/validate_or_raise() - update.py: UpdateBuilder for issue_update with set/add/remove operations - transition.py: Transition model for set_issue_status() - comment.py: Comment + Visibility for issue_add_comment() Also adds py.typed marker, convenience import alias (atlassian.jira_models), and 86 tests covering all modules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
atlassian.models.jirapackage that replaces manual JSON/dictionary construction with typed dataclasses, fluent builders, and a centralized serializer for all Jira issue operations.py.typedPEP 561 marker, and a convenience import alias (atlassian.jira_models).New modules
fields.pyto_dict()/from_dict()issues.pyJiraIssuebase + Task/Bug/Story/Epic/SubTask with__init_subclass__auto-registrybuilders.pyIssueBuilder[T]with per-type builders, ADF bridge,.validate()chainingserializer.pyFieldMapping+serialize()/to_fields_dict()/bulk_serialize()adf.pyADFBuilderfor Atlassian Document Format rich-text descriptionsvalidation.pyvalidate()/validate_or_raise()update.pyUpdateBuilderforissue_updatewith set/add/remove operationstransition.pyTransitionmodel forset_issue_status()comment.pyComment+Visibilityforissue_add_comment()Quick usage example
Test plan
pytest tests/test_jira_models.py -v)