##// END OF EJS Templates
Adds journal created_on attribute to issue API (#7111)....
Jean-Philippe Lang -
r4398:6a586c39e9f0
parent child
Show More
@@ -1,60 +1,61
1 1 api.issue do
2 2 api.id @issue.id
3 3 api.project(:id => @issue.project_id, :name => @issue.project.name) unless @issue.project.nil?
4 4 api.tracker(:id => @issue.tracker_id, :name => @issue.tracker.name) unless @issue.tracker.nil?
5 5 api.status(:id => @issue.status_id, :name => @issue.status.name) unless @issue.status.nil?
6 6 api.priority(:id => @issue.priority_id, :name => @issue.priority.name) unless @issue.priority.nil?
7 7 api.author(:id => @issue.author_id, :name => @issue.author.name) unless @issue.author.nil?
8 8 api.assigned_to(:id => @issue.assigned_to_id, :name => @issue.assigned_to.name) unless @issue.assigned_to.nil?
9 9 api.category(:id => @issue.category_id, :name => @issue.category.name) unless @issue.category.nil?
10 10 api.fixed_version(:id => @issue.fixed_version_id, :name => @issue.fixed_version.name) unless @issue.fixed_version.nil?
11 11 api.parent(:id => @issue.parent_id) unless @issue.parent.nil?
12 12
13 13 api.subject @issue.subject
14 14 api.description @issue.description
15 15 api.start_date @issue.start_date
16 16 api.due_date @issue.due_date
17 17 api.done_ratio @issue.done_ratio
18 18 api.estimated_hours @issue.estimated_hours
19 19 api.spent_hours(@issue.spent_hours) if User.current.allowed_to?(:view_time_entries, @project)
20 20
21 21 render_api_custom_values @issue.custom_field_values, api
22 22
23 23 api.created_on @issue.created_on
24 24 api.updated_on @issue.updated_on
25 25
26 26 render_api_issue_children(@issue, api) if include_in_api_response?('children')
27 27
28 28 api.array :relations do
29 29 @issue.relations.select {|r| r.other_issue(@issue).visible? }.each do |relation|
30 30 api.relation(:id => relation.id, :issue_id => relation.other_issue(@issue).id, :relation_type => relation.relation_type_for(@issue), :delay => relation.delay)
31 31 end
32 32 end if include_in_api_response?('relations')
33 33
34 34 api.array :changesets do
35 35 @issue.changesets.each do |changeset|
36 36 api.changeset :revision => changeset.revision do
37 37 api.user(:id => changeset.user_id, :name => changeset.user.name) unless changeset.user.nil?
38 38 api.comments changeset.comments
39 39 api.committed_on changeset.committed_on
40 40 end
41 41 end
42 42 end if include_in_api_response?('changesets') && User.current.allowed_to?(:view_changesets, @project)
43 43
44 44 api.array :journals do
45 45 @issue.journals.each do |journal|
46 46 api.journal :id => journal.id do
47 47 api.user(:id => journal.user_id, :name => journal.user.name) unless journal.user.nil?
48 48 api.notes journal.notes
49 api.created_on journal.created_on
49 50 api.array :details do
50 51 journal.details.each do |detail|
51 52 api.detail :property => detail.property, :name => detail.prop_key do
52 53 api.old_value detail.old_value
53 54 api.new_value detail.value
54 55 end
55 56 end
56 57 end
57 58 end
58 59 end
59 60 end if include_in_api_response?('journals')
60 61 end
General Comments 0
You need to be logged in to leave comments. Login now