Skip to content

refactor: Re-evaluate handling of raw custom fields in Jira issue models #155

@finxo

Description

@finxo

Summary

This task is to refactor the handling of the raw field for custom fields within the NetworkJiraIssue and UIJiraIssue models to improve maintainability and clarity.

Description

The current implementation for managing custom fields, particularly the use of a generic raw field in NetworkJiraIssue and UIJiraIssue, needs to be re-evaluated for a better design. The goal is to find a more robust, maintainable, and cleaner architecture for handling arbitrary custom field data from Jira.

Objectives

  • Improve code maintainability regarding Jira custom fields.
  • Reduce complexity in the NetworkJiraIssue and UIJiraIssue models.
  • Establish a clearer, more scalable pattern for custom field processing.

Current State

Currently, both NetworkJiraIssue and UIJiraIssue appear to use a generic raw field to store custom field data. This approach likely leads to unstructured data handling, requiring manual parsing at multiple points in the application, which can be error-prone and difficult to maintain.

Proposed Solution

Investigate and implement a more structured pattern for custom fields. This could involve creating dedicated data structures, using a well-defined dictionary, or implementing a strategy pattern to parse different custom field types. The objective is to replace the generic raw field with a more typed and predictable structure.

Tasks

  • Analyze the structure and usage of the raw field in NetworkJiraIssue and UIJiraIssue.
  • Propose and decide on a new design for handling custom fields.
  • Implement the new design.
  • Update all dependent code to use the new structure.
  • Ensure all related tests are updated and passing.

Acceptance Criteria

  • All existing tests pass after the changes.
  • No functional regressions are introduced; application behavior remains unchanged from a user's perspective.
  • The raw field for custom fields is replaced with a more structured and maintainable approach.

Testing Strategy

Regression Testing:

  • Execute the full test suite to ensure no existing functionality related to Jira issues is broken by the refactoring.

Considerations

This refactoring should not introduce any user-facing functional changes. The primary focus is on improving internal code quality and maintainability.

Metadata

Metadata

Assignees

Labels

refactorCode restructuring without changing behaviortechnical-debtTechnical debt that needs addressing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions