プロジェクト

全般

プロフィール

Vote #74093

未完了

Copy inner issues relations along with issues

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Issues_2
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
2
version_id:
32
issue_org_id:
14418
author_id:
69456
assigned_to_id:
0
comments:
13
status_id:
1
tracker_id:
2
plus1:
6
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

When one or more issues are copied, the relations get lost. This is especially annoying when a structure of issues with precedes/follows or blocks/blocked by relations gets copied.

To clarify this, especially when a list of issues gets copied, there are two possible types of relations:

  • the relations which are inside the copied structure
  • the relations that point out of the copied structure

In my opinion the first type (inner relations) should be automatically mapped to the new created (copied) structure.
This would be the same behavior as when a complete project is copied. For the second type it could also be reasonable to have a setting in the bulk-copy page like "Copy outer relations", if such relations are existing in the selected structure.

I think this bugfix would even resolve request #11647 to some extent, because then it would be possible to create one "template"-project from which frequently used structures (e.g. like a software release procedure etc.) could always be copied by the users to their "real" projects.


journals

+1
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
This would also be useful to us. we use a structure of issus -> child issues with set proceeds/follows as a template which is copied. At the moment the users just re-add the relationships manually but it would def add convenience to be able to maintain that.
--------------------------------------------------------------------------------
+1
I suggest all _proceed/follow_ relations should be copied. Also it would be perfect if there was an option to enable/disable creation of _copied to/from_ relations.
--------------------------------------------------------------------------------
+1
Much needed!
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
still important and relevant
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
It would be great, this feature missing me a lot
--------------------------------------------------------------------------------
This is how I do it in one of my private plugins:

<pre>
# Import issues
ids = @source.issues.roots.order(:id).map do |old_issue|
new_issue = old_issue.copy({ project: @project, notify: false }, { link: false })
new_issue.save!
[old_issue.id, new_issue.id]
end.to_h

# Recreate relations
@source.issues.roots.order(:id).each do |old_issue|
old_issue.relations_from.each do |relation|
attributes = relation.attributes.except('id')
attributes['issue_from_id'] = ids[attributes['issue_from_id']]
attributes['issue_to_id'] = ids[attributes['issue_to_id']]
IssueRelation.create!(attributes)
end
end
</pre>

I don't have time to make a patch for Issue#copy, but above code should be simple enough for others to be able to make a patch out of it.
--------------------------------------------------------------------------------
Selling a soul for this very necessary functionality. If someone made a patch, please share.
Redmine 4.1.1
--------------------------------------------------------------------------------


related_issues

relates,New,11647,Create Issue Structure Templates

Admin Redmine さんが3年以上前に更新

  • カテゴリIssues_2 にセット
  • 対象バージョンCandidate for next major release_32 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0