プロジェクト

全般

プロフィール

Vote #79066

未完了

Option to configure which trackers can be set as subtasks for each tracker

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

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

0%

予定工数:
category_id:
41
version_id:
32
issue_org_id:
27988
author_id:
107353
assigned_to_id:
107353
comments:
28
status_id:
1
tracker_id:
2
plus1:
1
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

A few months after we started using Redmine in "Zitec":https://zitec.com, we developed the "Redmine Restrict Tracker":https://github.com/zitec/redmine_restrict_tracker plugin which allows us to configure which trackers can be set as subtasks for each tracker.

Why we did the plugin?
We started with the following standard (for Agile development) trackers:

  1. Epic
  2. User Story
  3. Task
  4. Bug

After a few months, we observed a lot of mistakes made by our users: Epics having subtasks another Epics, Tasks having subtasks User Stories and so on.
Then we decide to create this plugin to restrict the subtasks to specific relations: Epics only with User Story trackers as subtasks, User Story only with Task and Bug trackers as subtasks, etc..

Current settings
The current workflow settings allows you to configure only if a tracker can/must be or not a subtasks (by making the field Parent task Read only, Required or Optional).

Because I find this feature very useful and a missing piece from the already powerful workflow settings, I've started work to a patch that implements this feature in the following way (different by the implementation from the plugin which has his own issues):

!subtasks.png!
According to the settings from the image, the Feature tracker can have as subtasks only issues with Bug and Support trackers.

Please let me know what you think about this feature and the proposed implementation.


journals

--------------------------------------------------------------------------------
+1 Even I agree with this feature with my company having the same workflow with an Agile Environment,

Users add tasks with parent as tasks which makes no meaning since tasks should be as subtasks in a User story and not any task.
--------------------------------------------------------------------------------
I am in favor of this feature and looking forward to the patch.

This enhancement can enforce team members to make proper parent-child relations. I think both subtasking and workflow are the strong point of Redmine. This enhancement makes the strength more powerful.

--------------------------------------------------------------------------------
Attached 3 patches for this feature:

*1. 0001-Option-to-configure-which-trackers-can-be-set-as-sub.patch*
* Adds the possibility for admins to configure in the tracker page which trackers can be set as subtasks
* Trackers with the parent field disabled are rendered as disabled in the subtasks section
* When the parent field is disabled for a tracker, all the relations that contain the respective tracker as subtask are removed. In this way, we keep only valid relations and we avoid to check every time if the parent field is enabled or not
* In order to not change the current behaviour, all trackers can have as subtasks all trackers (by default).
* On save, parent tracker relation is validated.

*2. 0002-Add-subtask-link-should-open-the-new-issue-form-with.patch*
* The subtasks section is not shown if the issue has no subtasks and the issue cannot have anymore any subtask
* The new issue page opened from the Add subtask link take into consideration only valid parent - subtask relations.

*3. 0003-Auto-complete-should-propose-only-valid-parents.patch*
* The auto complete for parent task field propose only issues that can be a valid parent.

Any feedback is really appreciated because I've tested the patches only on my local environment. For sure, there are some things that can be improved.
--------------------------------------------------------------------------------
Thank you for posting the patch. But I encountered the following error when I tried to open "New issue" page.

<pre>
ActionView::Template::Error (undefined local variable or method `preview_text_path' for #<#<Class:0x007fd85add6aa0>:0x007fd85adc7c80>
Did you mean? preview_news_path
preview_issue_path):
37: :no_label => true %>
38: <% end %>
39: </p>
40: <%= wikitoolbar_for 'issue_description' %>
41: <% end %>
42:
43: <div id="attributes" class="attributes">

lib/redmine/wiki_formatting/markdown/helper.rb:22:in `wikitoolbar_for'
app/views/issues/_form.html.erb:40:in `block in _app_views_issues__form_html_erb___2543741584618465749_70283606699800'
.
.
.
</pre>
--------------------------------------------------------------------------------
Go MAEDA wrote:
> Thank you for posting the patch. But I encountered the following error when I tried to open "New issue" page.
>
> [...]

I'm receiving the same errors when I apply/revert the patches from #27758 and I don't restart the webserver. Can you try restarting your webserver?
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> I'm receiving the same errors when I apply/revert the patches from #27758 and I don't restart the webserver. Can you try restarting your webserver?

You are right, I made an elementary mistake. Sorry.
--------------------------------------------------------------------------------
I saw a confusing behavior of the patch.

Assume that an issue has some subtasks. And then a user disabled all subtask trackers for the tracker of the parent issue. The user can no longer add subtasks for the parent issue. This is an expected behavior.

But at the same time, the user cannot update any existing subtasks of the parent issue without removing the parent task. It is confusing behavior for me. I think existing parent - subtasks relations should be kept even after the subtask trackers setting is changed.
--------------------------------------------------------------------------------
Go MAEDA wrote:
> You are right, I made an elementary mistake. Sorry.
Don't worry, we all do.

Go MAEDA wrote:
> But at the same time, the user cannot update any existing subtasks of the parent issue without removing the parent task. It is confusing behavior for me. I think existing parent - subtasks relations should be kept even after the subtask trackers setting is changed.
Agree with you, we should validate the relation only on change. I've fixed this behaviour in the attached patch.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
It looks good, setting target version to 4.1.0.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Adding my two cents (as my feature request was considered as duplicate of this one)

There are some types of trackers (like "Story Blocker" or "Subtask") which makes sense only when it is a subtask.
Therefore I suggest adding additional checkbox "Subtask only" while creating new tracker.
When checked, new item can be created only as a Subtask, or in other words - the tracker must not be top-level tracker
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Kamil . wrote:
> Adding my two cents (as my feature request was considered as duplicate of this one)
>
> There are some types of trackers (like "Story Blocker" or "Subtask") which makes sense only when it is a subtask.
> Therefore I suggest adding additional checkbox "Subtask only" while creating new tracker.
> When checked, new item can be created only as a Subtask, or in other words - the tracker must not be top-level tracker

I think it really makes sense to support this behaviour along with this feature.
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> Kamil . wrote:
> > Adding my two cents (as my feature request was considered as duplicate of this one)
> >
> > There are some types of trackers (like "Story Blocker" or "Subtask") which makes sense only when it is a subtask.
> > Therefore I suggest adding additional checkbox "Subtask only" while creating new tracker.
> > When checked, new item can be created only as a Subtask, or in other words - the tracker must not be top-level tracker
>
> I think it really makes sense to support this behaviour along with this feature.

I can try to add this checkbox, but I’m a little bit worried about the complexity because in order to not confuse the admin users, we need also to modify in the Workflow -> Fields permissions the Parent Task field to be required and not editable for the users for those trackers that are marked as “Subtask only”. Is this ok?

--------------------------------------------------------------------------------
I was able to mark in the workflow the "Parent task" field as mandatory when the tracker is a subtask only (screenshots attached), but how we should handle the case when the user edits a workflow for multiple trackers (both subtask only and not subtask)? Should we add a warning?

--------------------------------------------------------------------------------
Hi Marius,

Thank you for the great patch! But I encounter a bug. I have the following setup: Tracker "Parent" has 2 possible subtasks "Child 1" and "Child 2".
When I add subtask from a "Parent" issue, the subtask's tracker automatically default to "Child 1", choosing "Child 2" will change it back to "Child 1", resulting not able to change tracker.
I found that in patch 2, I had to comment out this line from issues_helper.rb:
@issue.tracker_id = trackers.detect{|t| t.id == parent_tracker_id} ? parent_tracker_id : trackers.first@
and it fixes for me
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Dong Phan wrote:
> Hi Marius,
>
> Thank you for the great patch! But I encounter a bug. I have the following setup: Tracker "Parent" has 2 possible subtasks "Child 1" and "Child 2".
> When I add subtask from a "Parent" issue, the subtask's tracker automatically default to "Child 1", choosing "Child 2" will change it back to "Child 1", resulting not able to change tracker.
> I found that in patch 2, I had to comment out this line from issues_helper.rb:
> @issue.tracker_id = trackers.detect{|t| t.id == parent_tracker_id} ? parent_tracker_id : trackers.first@
> and it fixes for me

Hi, I had the same problem as you did and I resolved it by adding an unless modifier:

<pre>
issue.tracker_id = trackers.detect{|t| t.id == parent_tracker_id} ? parent_tracker_id : trackers.first unless params['issue']['tracker_id'].present?
</pre>

In this way when you try to create a subtask it autofills the tracker_id but when you change it again it won't.
Attached is the modified patch file.
--------------------------------------------------------------------------------
can u update this path in redmine 4.1
i need this patch strongly
im try to patch but alot of fails

--------------------------------------------------------------------------------
if u can when new issue just the main tracker available only not the tracker sub task
as example
if i have Tracker1,Tracker2,Tracker3 this main tracker,and Tracker 10,Tracker 11, Tracker12 subtasks
when i create new ISSUE the available tracker (1,2,3) and subtask tracker hidden
--------------------------------------------------------------------------------
Andrea Bonadei wrote:
> Dong Phan wrote:
> > Hi Marius,
> >
> > Thank you for the great patch! But I encounter a bug. I have the following setup: Tracker "Parent" has 2 possible subtasks "Child 1" and "Child 2".
> > When I add subtask from a "Parent" issue, the subtask's tracker automatically default to "Child 1", choosing "Child 2" will change it back to "Child 1", resulting not able to change tracker.
> > I found that in patch 2, I had to comment out this line from issues_helper.rb:
> > @issue.tracker_id = trackers.detect{|t| t.id == parent_tracker_id} ? parent_tracker_id : trackers.first@
> > and it fixes for me
>
> Hi, I had the same problem as you did and I resolved it by adding an unless modifier:
>
> [...]
>
> In this way when you try to create a subtask it autofills the tracker_id but when you change it again it won't.
> Attached is the modified patch file.
when im execute the patch my server jamed and tack long time
and give 414 error nginx

--------------------------------------------------------------------------------

I think one of the most important things you should look at it; for these projects that have many Main trackers and subtasks
i hope update these patchs.
--------------------------------------------------------------------------------
Moving this to version:"5.0.0" because the changes are quite big.
--------------------------------------------------------------------------------


related_issues

relates,Reopened,29470,Possibility to mark tracker as "Subtask only"

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

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

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

いいね!0
いいね!0