[re #12521] Added support for saving relations between issues
Ngl, this is one of the MR that I am really proud of.
In this MR, I added functionality to save relations (table relation
+ work_item_relation
) between issues within the same project (for now, we ignore issues from other projects and other links such as GitLab). How it works?
When processing issue, i immediatelly check if it has some linked issues - and if does, I try to load the issues from database - if they are not, I create "mock" work_unit
and work_item
entity that are later updated when processing over all the remaining issues.
I will give you short overview, why I had to change some logic of fetching and saving data. Jira's IssueLink's are composed by:
- name (e.g.
Blocked
) - the overall name for the TYPE of the IssueLink - inwards - relation e.g. from left to right (e.g.
blocks
) - outwards - relation e.g. from right to left (e.g.
blocked by
)
So we need to save these values as well - we need to indicate if it's outwards or inwards. We save this information into description
(this is fully my solution, because the Šmucr's pdf does not contain it - I will ask Mr. Pícha, but it seems as the best solution for me) - because in some edge cases, there is the Issue link with name e.g. Blocked
and it has both inward and outward properties named same (blocked
) - so we would not be able to track, which one is inwards and which one is outwards without saving two items (so for each issue type, we save the inward
and outward
).
The code (especially the updating of existing entities) can be cleaned in future, but for now, i would be happy if we merge it since it's working and we don't want to burn more time on these "details".
The linking was tested on Jira project POLYGENE and it worked well... :) I also tried to run repositories ANAKIA and AGILA after the POLYGENE one (if the pump is not somehow affected by these changes) and it worked and successfully saved data.
Wishing you good morning, Mr. Pavlíček, you can merge it immediatelly (I will most likely again sleep till 11am cuz i am night owl spending nights with SPADe pump <3).
How I feel after defeating issue links (just like Bri Bri Bicus Dicus Debicus Dedicus)