Feature #27988

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

Added by Marius BALTEANU 6 months ago. Updated 8 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues workflow
Target version:4.1.0
Resolution:

Description

A few months after we started using Redmine in Zitec, we developed the 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):


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.

subtasks.png (146 KB) Marius BALTEANU, 2018-01-14 17:15

0002-Add-subtask-link-should-open-the-new-issue-form-with.patch Magnifier (6.87 KB) Marius BALTEANU, 2018-05-01 14:26

0003-Auto-complete-should-propose-only-valid-parents.patch Magnifier (4.01 KB) Marius BALTEANU, 2018-05-01 14:28

0001-Option-to-configure-which-trackers-can-be-set-as-sub.patch Magnifier (55 KB) Marius BALTEANU, 2018-05-05 22:52

History

#1 Updated by Marius BALTEANU 6 months ago

  • Category set to Issues workflow

#2 Updated by Shreyas Moolya 6 months ago

+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.

#3 Updated by Go MAEDA 6 months ago

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.

#4 Updated by Marius BALTEANU 3 months ago

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.

#5 Updated by Go MAEDA 2 months ago

Thank you for posting the patch. But I encountered the following error when I tried to open "New issue" page.

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'
.
.
.

#6 Updated by Marius BALTEANU 2 months ago

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?

#7 Updated by Go MAEDA 2 months ago

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.

#8 Updated by Go MAEDA 2 months ago

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.

#9 Updated by Marius BALTEANU 2 months ago

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.

#10 Updated by Marius BALTEANU 2 months ago

  • File deleted (0001-Option-to-configure-which-trackers-can-be-set-as-sub.patch)

#11 Updated by Go MAEDA 2 months ago

  • Target version set to 4.1.0

It looks good, setting target version to 4.1.0.

#12 Updated by Go MAEDA 8 days ago

  • Assignee set to Jean-Philippe Lang

Also available in: Atom PDF