Startrekzky opened a new issue, #5688:
URL: https://github.com/apache/incubator-devlake/issues/5688

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) 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 table(s) to store the relationship between issues.  The minimal 
required attributes are:
      - issue_id
      - relation
      - target_issue_id
      - original_relation
   - [ ] The index of these table(s) should consider the SQL above
   - [ ] Start from collecting the issue relationship in Jira plugin in v0.19
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to