Skip to content

[Feature][Data Model] Modeling issue relations #5688

@Startrekzky

Description

@Startrekzky

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Use case

As a product manager, I want to measure

  • the number of bugs associated with a feature, or
  • the total development time of subtasks under a story, or
  • the duration of tasks associated with a story. Therefore, DevLake is required to store the relationship between issues.

However, DevLake v0.18 does not have an entity that stores the relationship between issues except for a parent_issue_id field in the issues table.

Description

Solution

Provide table(s) to model the relationship between issues. The table(s) are designed for measuring metrics by SQL like:

-- Assume that table issue_relations has 3 fields issue_1, original_relation, relation, issue_2
-- The following SQL is what DevLake users would be writing

select i1.id, i1.title, sum(i2.time_spent_minutes), sum(i2.eloc) 
from issues i1
    join issue_relations ir on i1.id = ir.issue_1_id
    join issues i2 on ir.issue_2_id = i2.id
where 
    -- Users have to customize the values of `type` and `relation`
    i1.type = 'user-story'
    and ir.relation = 'related-to'
group by 1,2

Action Items

  • design: Design table(s) to store the relationship between issues, the index of the table(s) should consider the SQL above. The minimal required attributes are:
    • issue_id
    • relation
    • target_issue_id
    • original_relation
  • coding: Collect the issue relationship data in Jira plugin in v0.19. (TAPD, Zentao for later)
  • docs: Add the table description to the domain layer doc

Related issues

related to #5747

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

type/feature-requestThis issue is a proposal for something new

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions