Feature #27988
openOption to configure which trackers can be set as subtasks for each tracker
Added by Marius BĂLTEANU almost 7 years ago. Updated 5 months ago.
0%
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
subtasks.png (146 KB) subtasks.png | Marius BĂLTEANU, 2018-01-14 17:15 | ||
0002-Add-subtask-link-should-open-the-new-issue-form-with.patch (6.87 KB) 0002-Add-subtask-link-should-open-the-new-issue-form-with.patch | Marius BĂLTEANU, 2018-05-01 14:26 | ||
0003-Auto-complete-should-propose-only-valid-parents.patch (4.01 KB) 0003-Auto-complete-should-propose-only-valid-parents.patch | Marius BĂLTEANU, 2018-05-01 14:28 | ||
0001-Option-to-configure-which-trackers-can-be-set-as-sub.patch (55 KB) 0001-Option-to-configure-which-trackers-can-be-set-as-sub.patch | Marius BĂLTEANU, 2018-05-05 22:52 | ||
subtask_only.png (57.9 KB) subtask_only.png | Marius BĂLTEANU, 2019-06-26 00:37 | ||
workflow_subtask_only.png (226 KB) workflow_subtask_only.png | Marius BĂLTEANU, 2019-06-26 00:39 | ||
0002-Add-subtask-link-should-open-the-new-issue-form-with-v2.patch (6.91 KB) 0002-Add-subtask-link-should-open-the-new-issue-form-with-v2.patch | The modified patch | Andrea Bonadei, 2019-11-15 12:03 |
Related issues
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.
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.
Updated by Marius BĂLTEANU over 6 years ago
- File 0001-Option-to-configure-which-trackers-can-be-set-as-sub.patch added
- File 0002-Add-subtask-link-should-open-the-new-issue-form-with.patch 0002-Add-subtask-link-should-open-the-new-issue-form-with.patch added
- File 0003-Auto-complete-should-propose-only-valid-parents.patch 0003-Auto-complete-should-propose-only-valid-parents.patch added
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.
- 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.
- 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.
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' . . .
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?
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.
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.
Updated by Marius BĂLTEANU over 6 years ago
- File 0001-Option-to-configure-which-trackers-can-be-set-as-sub.patch 0001-Option-to-configure-which-trackers-can-be-set-as-sub.patch added
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.
Updated by Marius BĂLTEANU over 6 years ago
- File deleted (
0001-Option-to-configure-which-trackers-can-be-set-as-sub.patch)
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.
Updated by Marius BĂLTEANU about 6 years ago
- Has duplicate Feature #29470: Possibility to mark tracker as "Subtask only" added
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
Updated by Marius BĂLTEANU about 6 years ago
- Has duplicate deleted (Feature #29470: Possibility to mark tracker as "Subtask only")
Updated by Marius BĂLTEANU about 6 years ago
- Related to Feature #29470: Possibility to mark tracker as "Subtask only" added
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.
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 trackerI 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?
Updated by Marius BĂLTEANU over 5 years ago
- File subtask_only.png subtask_only.png added
- File workflow_subtask_only.png workflow_subtask_only.png added
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?
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
Updated by Marius BĂLTEANU about 5 years ago
- Assignee changed from Jean-Philippe Lang to Marius BĂLTEANU
Updated by Andrea Bonadei almost 5 years ago
- File 0002-Add-subtask-link-should-open-the-new-issue-form-with-v2.patch 0002-Add-subtask-link-should-open-the-new-issue-form-with-v2.patch added
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.
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
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
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 meHi, 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
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.
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.
Updated by Marius BĂLTEANU over 2 years ago
- Target version changed from 5.0.0 to Candidate for next major release
Updated by Veit Jahns almost 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. :(
Updated by Alp Prof about 1 year ago
Marius BĂLTEANU, any chance for releasing this update?