To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / app / views / issues / show.api.rsb @ 441:cbce1fd3b1b7
History | View | Annotate | Download (2.74 KB)
| 1 |
api.issue do |
|---|---|
| 2 |
api.id @issue.id |
| 3 |
api.project(:id => @issue.project_id, :name => @issue.project.name) unless @issue.project.nil? |
| 4 |
api.tracker(:id => @issue.tracker_id, :name => @issue.tracker.name) unless @issue.tracker.nil? |
| 5 |
api.status(:id => @issue.status_id, :name => @issue.status.name) unless @issue.status.nil? |
| 6 |
api.priority(:id => @issue.priority_id, :name => @issue.priority.name) unless @issue.priority.nil? |
| 7 |
api.author(:id => @issue.author_id, :name => @issue.author.name) unless @issue.author.nil? |
| 8 |
api.assigned_to(:id => @issue.assigned_to_id, :name => @issue.assigned_to.name) unless @issue.assigned_to.nil? |
| 9 |
api.category(:id => @issue.category_id, :name => @issue.category.name) unless @issue.category.nil? |
| 10 |
api.fixed_version(:id => @issue.fixed_version_id, :name => @issue.fixed_version.name) unless @issue.fixed_version.nil? |
| 11 |
api.parent(:id => @issue.parent_id) unless @issue.parent.nil? |
| 12 |
|
| 13 |
api.subject @issue.subject |
| 14 |
api.description @issue.description |
| 15 |
api.start_date @issue.start_date |
| 16 |
api.due_date @issue.due_date |
| 17 |
api.done_ratio @issue.done_ratio |
| 18 |
api.estimated_hours @issue.estimated_hours |
| 19 |
api.spent_hours(@issue.spent_hours) if User.current.allowed_to?(:view_time_entries, @project) |
| 20 |
|
| 21 |
render_api_custom_values @issue.custom_field_values, api |
| 22 |
|
| 23 |
api.created_on @issue.created_on |
| 24 |
api.updated_on @issue.updated_on |
| 25 |
|
| 26 |
render_api_issue_children(@issue, api) if include_in_api_response?('children')
|
| 27 |
|
| 28 |
api.array :relations do |
| 29 |
@relations.each do |relation| |
| 30 |
api.relation(:id => relation.id, :issue_id => relation.other_issue(@issue).id, :relation_type => relation.relation_type_for(@issue), :delay => relation.delay) |
| 31 |
end |
| 32 |
end if include_in_api_response?('relations') && @relations.present?
|
| 33 |
|
| 34 |
api.array :changesets do |
| 35 |
@issue.changesets.each do |changeset| |
| 36 |
api.changeset :revision => changeset.revision do |
| 37 |
api.user(:id => changeset.user_id, :name => changeset.user.name) unless changeset.user.nil? |
| 38 |
api.comments changeset.comments |
| 39 |
api.committed_on changeset.committed_on |
| 40 |
end |
| 41 |
end |
| 42 |
end if include_in_api_response?('changesets') && User.current.allowed_to?(:view_changesets, @project)
|
| 43 |
|
| 44 |
api.array :journals do |
| 45 |
@issue.journals.each do |journal| |
| 46 |
api.journal :id => journal.id do |
| 47 |
api.user(:id => journal.user_id, :name => journal.user.name) unless journal.user.nil? |
| 48 |
api.notes journal.notes |
| 49 |
api.created_on journal.created_on |
| 50 |
api.array :details do |
| 51 |
journal.details.each do |detail| |
| 52 |
api.detail :property => detail.property, :name => detail.prop_key do |
| 53 |
api.old_value detail.old_value |
| 54 |
api.new_value detail.value |
| 55 |
end |
| 56 |
end |
| 57 |
end |
| 58 |
end |
| 59 |
end |
| 60 |
end if include_in_api_response?('journals')
|
| 61 |
end |