Define default relation between issues

Added by Lovely Sidhu 9 months ago

Hi!

Who knows how change default relation between issues? In default, there is "linked with" relation. I want to change to the relation "next". In other words when I open "Related issues", the first one is "related to", but I want "next" in the first string.

Thanks
https://tobefrankmagazine.com/tech/jiofi-unlock-firmware-download/
https://alltechbest.com/sites-like-worldstar/

Replies (1)

RE: Define default relation between issues - Added by Nikolai Efimov-Soini 9 months ago

It's possible. You need to change the file .../redmine/app/models/issue_relation.rb
In this file change the raltions order . E.g.:

Default order:

TYPE_RELATES => { :name => :label_relates_to, :sym_name => :label_relates_to,
:order => 1, :sym => TYPE_RELATES },
TYPE_DUPLICATES => { :name => :label_duplicates, :sym_name => :label_duplicated_by,
:order => 2, :sym => TYPE_DUPLICATED },

change to:

TYPE_RELATES => { :name => :label_relates_to, :sym_name => :label_relates_to,
:order => 2, :sym => TYPE_RELATES },
TYPE_DUPLICATES => { :name => :label_duplicates, :sym_name => :label_duplicated_by,
:order => 1, :sym => TYPE_DUPLICATED },

Futher change here:

def initialize(attributes=nil, *args)
super
if new_record?
if relation_type.blank?
self.relation_type = IssueRelation::TYPE_RELATES
end
end
end

To:
def initialize(attributes=nil, *args)
super
if new_record?
if relation_type.blank?
self.relation_type = IssueRelation::TYPE_DUPLICATED
end
end
end

(1-1/1)