Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
redmine_v2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
redmine_v2
Commits
749bf6af
Commit
749bf6af
authored
Apr 18, 2019
by
Hiếu Lê
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Auto delete subtask when change tracker from User Story to Support
parent
2ce4366e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
app/controllers/issues_controller.rb
+12
-0
No files found.
app/controllers/issues_controller.rb
View file @
749bf6af
...
@@ -192,6 +192,9 @@ class IssuesController < ApplicationController
...
@@ -192,6 +192,9 @@ class IssuesController < ApplicationController
if
original_tracker_id
!=
12
if
original_tracker_id
!=
12
auto_create_subtasks
(
@issue
)
auto_create_subtasks
(
@issue
)
end
end
if
original_tracker_id
==
12
auto_delete_subtasks
(
@issue
)
end
else
else
respond_to
do
|
format
|
respond_to
do
|
format
|
...
@@ -622,5 +625,14 @@ class IssuesController < ApplicationController
...
@@ -622,5 +625,14 @@ class IssuesController < ApplicationController
subtask
.
save!
subtask
.
save!
end
end
end
end
# Auto delete 8 subtasks (13/08/2018)
def
auto_delete_subtasks
(
issue
)
exclude_project_ids
=
[
106
,
107
,
108
,
109
,
110
,
111
]
#2zigexn
return
if
exclude_project_ids
.
include?
(
issue
.
project_id
)
return
if
@issue
.
tracker_id
!=
3
#Support
#Remove subtasks when change from User Story to Support
Issue
.
where
(
tracker_id:
8
,
parent_id:
@issue
.
id
).
delete_all
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment