-
Notifications
You must be signed in to change notification settings - Fork 4
/
grs.patch
82 lines (78 loc) · 3.52 KB
/
grs.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
commit a36df6d1c878fe5db87b5302b936b978f36ea116
Author: celogeek <[email protected]>
Date: Mon Mar 21 18:26:46 2016 +0000
GRS v3.2.1
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index e04888e..2c07dab 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -508,6 +508,7 @@ module IssuesHelper
api.issue(:id => child.id) do
api.tracker(:id => child.tracker_id, :name => child.tracker.name) unless child.tracker.nil?
api.subject child.subject
+ render_api_custom_values child.custom_field_values, api
render_api_issue_children(child, api)
end
end
diff --git a/app/views/issues/index.api.rsb b/app/views/issues/index.api.rsb
index 7660ccb..fa85c04 100644
--- a/app/views/issues/index.api.rsb
+++ b/app/views/issues/index.api.rsb
@@ -2,7 +2,7 @@ api.array :issues, api_meta(:total_count => @issue_count, :offset => @offset, :l
@issues.each do |issue|
api.issue do
api.id issue.id
- api.project(:id => issue.project_id, :name => issue.project.name) unless issue.project.nil?
+ api.project(:id => issue.project_id, :name => issue.project.name, :identifier => issue.project.identifier) unless issue.project.nil?
api.tracker(:id => issue.tracker_id, :name => issue.tracker.name) unless issue.tracker.nil?
api.status(:id => issue.status_id, :name => issue.status.name) unless issue.status.nil?
api.priority(:id => issue.priority_id, :name => issue.priority.name) unless issue.priority.nil?
diff --git a/app/views/issues/show.api.rsb b/app/views/issues/show.api.rsb
index 577a885..0552419 100644
--- a/app/views/issues/show.api.rsb
+++ b/app/views/issues/show.api.rsb
@@ -1,6 +1,6 @@
api.issue do
api.id @issue.id
- api.project(:id => @issue.project_id, :name => @issue.project.name) unless @issue.project.nil?
+ api.project(:id => @issue.project_id, :name => @issue.project.name, :identifier => @issue.project.identifier) unless @issue.project.nil?
api.tracker(:id => @issue.tracker_id, :name => @issue.tracker.name) unless @issue.tracker.nil?
api.status(:id => @issue.status_id, :name => @issue.status.name) unless @issue.status.nil?
api.priority(:id => @issue.priority_id, :name => @issue.priority.name) unless @issue.priority.nil?
diff --git a/app/views/projects/index.api.rsb b/app/views/projects/index.api.rsb
index d309af2..34d5e90 100644
--- a/app/views/projects/index.api.rsb
+++ b/app/views/projects/index.api.rsb
@@ -14,6 +14,13 @@ api.array :projects, api_meta(:total_count => @project_count, :offset => @offset
api.created_on project.created_on
api.updated_on project.updated_on
+
+ api.array :custom_fields do
+ project.all_issue_custom_fields.each do |cf|
+ api.custom_field(:id => cf.id, :name => cf.name)
+ end
+ end if include_in_api_response?('custom_fields')
+
end
end
end
diff --git a/app/views/projects/show.api.rsb b/app/views/projects/show.api.rsb
index 6e1958a..3d4b1fa 100644
--- a/app/views/projects/show.api.rsb
+++ b/app/views/projects/show.api.rsb
@@ -13,4 +13,16 @@ api.project do
api.created_on @project.created_on
api.updated_on @project.updated_on
+
+ api.array :members do
+ @project.members.each do |member|
+ api.member(:id => member.user.id, :name => member.user.name)
+ end
+ end if include_in_api_response?('members')
+
+ api.array :custom_fields do
+ @project.all_issue_custom_fields.each do |cf|
+ api.custom_field(:id => cf.id, :name => cf.name)
+ end
+ end if include_in_api_response?('custom_fields')
end