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 @ 1350:bb6e7589720e
History | View | Annotate | Download (2.91 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 :attachments do |
| 29 |
@issue.attachments.each do |attachment| |
| 30 |
render_api_attachment(attachment, api) |
| 31 |
end |
| 32 |
end if include_in_api_response?('attachments')
|
| 33 |
|
| 34 |
api.array :relations do |
| 35 |
@relations.each do |relation| |
| 36 |
api.relation(:id => relation.id, :issue_id => relation.issue_from_id, :issue_to_id => relation.issue_to_id, :relation_type => relation.relation_type, :delay => relation.delay) |
| 37 |
end |
| 38 |
end if include_in_api_response?('relations') && @relations.present?
|
| 39 |
|
| 40 |
api.array :changesets do |
| 41 |
@issue.changesets.each do |changeset| |
| 42 |
api.changeset :revision => changeset.revision do |
| 43 |
api.user(:id => changeset.user_id, :name => changeset.user.name) unless changeset.user.nil? |
| 44 |
api.comments changeset.comments |
| 45 |
api.committed_on changeset.committed_on |
| 46 |
end |
| 47 |
end |
| 48 |
end if include_in_api_response?('changesets') && User.current.allowed_to?(:view_changesets, @project)
|
| 49 |
|
| 50 |
api.array :journals do |
| 51 |
@journals.each do |journal| |
| 52 |
api.journal :id => journal.id do |
| 53 |
api.user(:id => journal.user_id, :name => journal.user.name) unless journal.user.nil? |
| 54 |
api.notes journal.notes |
| 55 |
api.created_on journal.created_on |
| 56 |
api.array :details do |
| 57 |
journal.details.each do |detail| |
| 58 |
api.detail :property => detail.property, :name => detail.prop_key do |
| 59 |
api.old_value detail.old_value |
| 60 |
api.new_value detail.value |
| 61 |
end |
| 62 |
end |
| 63 |
end |
| 64 |
end |
| 65 |
end |
| 66 |
end if include_in_api_response?('journals')
|
| 67 |
end |