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
4164867a
Commit
4164867a
authored
Dec 11, 2023
by
Tấn Trần Thanh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix comment
parent
9059d20b
Pipeline
#1604
failed with stages
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
plugins/workflow_report/app/models/workflow_report_issue.rb
+3
-1
plugins/workflow_report/lib/workflow_report.rb
+6
-4
No files found.
plugins/workflow_report/app/models/workflow_report_issue.rb
View file @
4164867a
class
WorkflowReportIssue
<
Issue
BUG_TRACKER_ID
=
1
CLOSED_STATUS_PROJECT
=
9
belongs_to
:workflow_report_version
,
class_name:
'Version'
,
foreign_key:
'fixed_version_id'
has_many
:workflow_report_custom_values
,
class_name:
'WorkflowReportCustomValue'
,
foreign_key:
'customized_id'
scope
:raw_tasks_records
,
->
(
year
,
month
,
project_ids
)
{
includes
(
:project
,
:workflow_report_version
,
:workflow_report_custom_values
,
:time_entries
,
:status
,
project: :enabled_modules
)
.
where
.
not
(
projects:
{
status:
9
},
issues:
{
tracker_id:
1
})
.
where
.
not
(
projects:
{
status:
CLOSED_STATUS_PROJECT
},
issues:
{
tracker_id:
BUG_TRACKER_ID
})
.
where
(
projects:
{
id:
project_ids
},
enabled_modules:
{
name:
'time_tracking'
})
.
where
([
'((time_entries.spent_on IS NOT NULL AND time_entries.tyear = ? AND time_entries.tmonth = ?) OR (issues.closed_on BETWEEN ? AND ?))'
,
year
,
month
,
DateTime
.
new
(
year
,
month
).
beginning_of_day
,
DateTime
.
new
(
year
,
month
,
-
1
).
end_of_day
])
...
...
plugins/workflow_report/lib/workflow_report.rb
View file @
4164867a
...
...
@@ -8,6 +8,8 @@ module WorkflowReport
PR_FIELD_ID
=
18
JP_REQUEST_FIELD_ID
=
16
BUG_COLS
=
28
USER_STORY_TRACKER_ID
=
12
COL_REQUIREMENT_TO_RELEASE
=
6
PROCESS
=
[
'1. Requirement'
,
'2. Design'
,
'3. Coding'
,
'4. Testing'
,
'5. Bug fixing'
,
'6. Release'
,
''
].
freeze
BUGS
=
{
testcases:
22
,
bugs:
23
,
stg_bugs:
27
,
prod_bugs:
28
}.
freeze
...
...
@@ -61,7 +63,7 @@ module WorkflowReport
pull_request
=
''
jp_request
=
''
issues
.
each
do
|
issue
|
if
issue
.
tracker_id
==
12
if
issue
.
tracker_id
==
USER_STORY_TRACKER_ID
pull_request
=
issue
.
custom_values
.
find_by
(
custom_field_id:
PR_FIELD_ID
)
&
.
value
jp_request
=
issue
.
custom_values
.
find_by
(
custom_field_id:
JP_REQUEST_FIELD_ID
)
&
.
value
end
...
...
@@ -78,12 +80,12 @@ module WorkflowReport
end
end
else
6
.
times
do
|
index
|
COL_REQUIREMENT_TO_RELEASE
.
times
do
|
index
|
build_est_to_actual_time!
(
result
,
EST_DETAIL_FIRST_COL
,
0
,
index
)
build_est_to_actual_time!
(
result
,
ACTUAL_TIME_DETAIL_FIRST_COL
,
0
,
index
)
end
build_est_to_actual_time!
(
result
,
EST_DETAIL_FIRST_COL
,
issue
.
estimated_hours
.
to_f
,
6
)
build_est_to_actual_time!
(
result
,
ACTUAL_TIME_DETAIL_FIRST_COL
,
issue
.
spent_hours
.
to_f
,
6
)
build_est_to_actual_time!
(
result
,
EST_DETAIL_FIRST_COL
,
issue
.
estimated_hours
.
to_f
,
COL_REQUIREMENT_TO_RELEASE
)
build_est_to_actual_time!
(
result
,
ACTUAL_TIME_DETAIL_FIRST_COL
,
issue
.
spent_hours
.
to_f
,
COL_REQUIREMENT_TO_RELEASE
)
end
end
if
sum_estimated_hours
.
zero?
...
...
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