Project

General

Profile

Actions

Feature #27988

open

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

Added by Marius BĂLTEANU almost 7 years ago. Updated 6 months ago.

Status:
New
Priority:
Normal
Category:
Issues workflow
Start date:
Due date:
% Done:

0%

Estimated time:
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.


Files


Related issues

Related to Redmine - Feature #29470: Possibility to mark tracker as "Subtask only"ReopenedJean-Philippe Lang

Actions
Actions #1

Updated by Marius BĂLTEANU almost 7 years ago

  • Category set to Issues workflow
Actions #2

Updated by Shreyas Moolya almost 7 years 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.

Actions #3

Updated by Go MAEDA almost 7 years 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.

Actions #4

Updated by Marius BĂLTEANU over 6 years 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.

Actions #5

Updated by Go MAEDA over 6 years 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'
.
.
.
Actions #6

Updated by Marius BĂLTEANU over 6 years 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?

Actions #7

Updated by Go MAEDA over 6 years 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.

Actions #8

Updated by Go MAEDA over 6 years 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.

Actions #9

Updated by Marius BĂLTEANU over 6 years 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.

Actions #10

Updated by Marius BĂLTEANU over 6 years ago

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

Updated by Go MAEDA over 6 years ago

  • Target version set to 4.1.0

It looks good, setting target version to 4.1.0.

Actions #12

Updated by Go MAEDA over 6 years ago

  • Assignee set to Jean-Philippe Lang
Actions #13

Updated by Marius BĂLTEANU about 6 years ago

  • Has duplicate Feature #29470: Possibility to mark tracker as "Subtask only" added
Actions #14

Updated by Kamil . about 6 years ago

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

Actions #15

Updated by Marius BĂLTEANU about 6 years ago

  • Has duplicate deleted (Feature #29470: Possibility to mark tracker as "Subtask only")
Actions #16

Updated by Marius BĂLTEANU about 6 years ago

  • Related to Feature #29470: Possibility to mark tracker as "Subtask only" added
Actions #17

Updated by Jean-Philippe Lang over 5 years ago

  • Target version changed from 4.1.0 to 4.2.0

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.

Actions #18

Updated by Marius BĂLTEANU over 5 years ago

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?

Actions #19

Updated by Marius BĂLTEANU over 5 years ago

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?

Actions #20

Updated by Dong Phan about 5 years ago

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

Actions #21

Updated by Marius BĂLTEANU about 5 years ago

  • Assignee changed from Jean-Philippe Lang to Marius BĂLTEANU
Actions #22

Updated by Andrea Bonadei about 5 years ago

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:

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

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.

Actions #23

Updated by ashraf alzyoud about 4 years ago

can u update this path in redmine 4.1
i need this patch strongly
im try to patch but alot of fails

Actions #24

Updated by ashraf alzyoud about 4 years ago

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

Actions #25

Updated by ashraf alzyoud about 4 years ago

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

Actions #26

Updated by ashraf alzyoud about 4 years ago

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.

Actions #27

Updated by Marius BĂLTEANU over 3 years ago

  • Target version changed from 4.2.0 to 5.0.0

Moving this to 5.0.0 because the changes are quite big.

Actions #28

Updated by Marius BĂLTEANU over 2 years ago

  • Target version changed from 5.0.0 to Candidate for next major release
Actions #29

Updated by ashraf alzyoud over 2 years ago

any update ???

Actions #30

Updated by Alessandro Zucchi over 2 years ago

+1

Actions #31

Updated by Veit Jahns about 2 years ago

+1 Would make the work of one of our users easier. But unfortunately, we don't have resources available to contribute to this request. :(

Actions #32

Updated by Ctrl Sup about 1 year ago

+1

Actions #33

Updated by Alp Prof about 1 year ago

+1 realy need update

Actions #34

Updated by C S about 1 year ago

+1 That would be extremely helpful

Actions #35

Updated by Alp Prof about 1 year ago

Marius BĂLTEANU, any chance for releasing this update?

Actions #36

Updated by Joerg Poeltl 6 months ago

+1 this is an important feature

Actions

Also available in: Atom PDF