Does anybody have a generic relation implementation
"John P. Rouillard" <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Everybody:
I have been working with Jira at $work and they support setting up
relationships between tickets similar to links or mulitilinks. However
you can define the relationship type and the target of the
relationship can be of different types.
So for example I could create the following links:
1 issue1 blocks issue2
2 issue1 is blocked by issue3 (same as issue3 blocks issue1)
3 issue1 is a subtask of issue24
4 issue1 is a derivative of ticket22
5 issue1 references https://somewhere.something (not jira but
something I have wanted to do)
I was thinking about how I would implement this generic set of links.
Consider an object called LinkRelation with the fields:
type - link to relation_type
issue - link to issue
ticket - link to ticket
url - string
where relation_type has properties:
name: block, subtask, derivative, reference, etc.
from_subject: text when relation is seen from the subject of relation
e.g. blocks, is subtask, is derivative
from_target: text when relation is viewed from object of relation
e.g. is blocked by, is parent task, derives
To create the example relationships above, issue1 (the subject) would
have the values ["1", "3", "4", "5"] in its Relationships
property. The LinkRelations would be:
LinkRelation1 type=block issue=2 ticket=None url=(empty)
LinkRelation3 type=subtask issue=24 ticket=None url=(empty)
LinkRelation4 type=derivative issue=None ticket=22 url=(empty)
LinkRelation5 type=reference issue=None ticket=None
url=https://somewhere.something
Issue3 would have a Relationships value of ["2"] with:
LinkRelation2 type=block issue=1 ticket=None url=(empty)
LinkRelations have two different descriptions. One description if
the relation is viewed from the subject and a different description if
viewed from the object of the relation.
So a single "block" relationship, generates both:
issue1 blocks issue3 (if you are viewing issue1)
and
issue3 is blocked by issue1 (if you are viewing issue3)
Just seen from different sides. Similarly a link type subtask could
be:
issue5 is a subtask of issue10
and
issue10 is parent task of issue5
Note that the LinkRelation doesn't have a field for the subject. The
subject is implicitly defined by the object (issue, ticket ...) that
references the LinkRelation in its Relations property.
I have a feeling this simple implementation will not perform very
well. It probably has other issues that I haven't thought of.
Has anybody done something like this or thought about this generic
relationship idea?
Have a great week.
--
-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.