Subject: [PATCH] order the related issues by status and priority --- Index: app/helpers/issues_helper.rb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb --- a/app/helpers/issues_helper.rb (revision bb52c65232a15875e89705985fa16b7a7b3fecc0) +++ b/app/helpers/issues_helper.rb (date 1746804974202) @@ -201,7 +201,16 @@ def render_issue_relations(issue, relations) manage_relations = User.current.allowed_to?(:manage_issue_relations, issue.project) s = ''.html_safe - relations.each do |relation| + # Sort relations by tracker order and then by priority in descending order + sorted_relations = relations.sort_by do |relation| + other_issue = relation.other_issue(issue) + [ + other_issue.status.name.downcase, # Sort by status name + -other_issue.priority.position # Use negative value for descending order + ] + end + + sorted_relations.each do |relation| other_issue = relation.other_issue(issue) css = "issue hascontextmenu #{other_issue.css_classes} #{relation.css_classes_for(other_issue)}" buttons =