Skip to content

Commit d83a97b

Browse files
committed
Adds missing fields
1 parent 0667b26 commit d83a97b

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

lib/redmine_gtt_print/issue_to_json.rb

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,39 +34,38 @@ def self.attributes_hash(issue, other_attributes)
3434
id: issue.id,
3535
subject: issue.subject,
3636
project_id: issue.project_id,
37-
project_name: "WIP",
37+
project_name: (Project.find issue.project_id).name,
3838
tracker_id: issue.tracker_id,
39-
tracker_name: "WIP",
39+
tracker_name: (Tracker.find issue.tracker_id).name,
4040
status_id: issue.status_id,
41-
status_name: "WIP",
41+
status_name: (IssueStatus.find issue.status_id).name,
4242
priority_id: issue.priority_id,
43-
priority_name: "WIP",
43+
priority_name: (IssuePriority.find issue.priority_id).name,
4444
# category_id: issue.category_id,
4545
author_id: issue.author_id,
46-
author_name: "WIP",
46+
author_name: (User.find issue.author_id).name,
4747
assigned_to_id: issue.assigned_to_id,
48-
assigned_to_name: "WIP",
48+
assigned_to_name: issue.assigned_to_id ? (User.find issue.author_id).name : "WIP",
4949
description: issue.description,
5050
is_private: issue.is_private,
5151
start_date: issue.start_date,
5252
done_date: issue.closed_on,
5353
# due_date: issue.due_date,
5454
estimated_hours: issue.estimated_hours,
55-
total_estimated_hours: "WIP",
5655
created_on: issue.created_on,
5756
updated_on: issue.updated_on,
5857

5958
# Custom text
60-
# custom_text: other_attributes[:custom_text]
59+
custom_text: other_attributes[:custom_text]
6160

6261
# Experimental
6362
# issue: issue,
6463
# project: (Project.find issue.project_id),
6564
# tracker: (Tracker.find issue.tracker_id),
66-
# status: (Status.find issue.status_id),
67-
# priority: (Priority.find issue.priority_id),
68-
# author: (Author.find issue.author_id),
69-
# assigned_to: (Assigned_to.find issue.assigned_to_id),
65+
# status: (IssueStatus.find issue.status_id),
66+
# priority: (IssuePriority.find issue.priority_id),
67+
# author: (User.find issue.author_id),
68+
# assigned_to: (User.find issue.assigned_to_id),
7069
}
7170
end
7271

0 commit comments

Comments
 (0)