Commit 80e147a7 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'issue_11239' into 'master'

Expose epics closed_at on API

See merge request gitlab-org/gitlab!17156
parents b8a9da74 3d19c9d6
...@@ -88,6 +88,7 @@ Example response: ...@@ -88,6 +88,7 @@ Example response:
"due_date_from_milestones": "2018-07-31", "due_date_from_milestones": "2018-07-31",
"created_at": "2018-07-17T13:36:22.770Z", "created_at": "2018-07-17T13:36:22.770Z",
"updated_at": "2018-07-18T12:22:05.239Z", "updated_at": "2018-07-18T12:22:05.239Z",
"closed_at": "2018-08-18T12:22:05.239Z",
"labels": [], "labels": [],
"upvotes": 4, "upvotes": 4,
"downvotes": 0 "downvotes": 0
...@@ -143,6 +144,7 @@ Example response: ...@@ -143,6 +144,7 @@ Example response:
"due_date_from_milestones": "2018-07-31", "due_date_from_milestones": "2018-07-31",
"created_at": "2018-07-17T13:36:22.770Z", "created_at": "2018-07-17T13:36:22.770Z",
"updated_at": "2018-07-18T12:22:05.239Z", "updated_at": "2018-07-18T12:22:05.239Z",
"closed_at": "2018-08-18T12:22:05.239Z",
"labels": [], "labels": [],
"upvotes": 4, "upvotes": 4,
"downvotes": 0 "downvotes": 0
...@@ -209,6 +211,7 @@ Example response: ...@@ -209,6 +211,7 @@ Example response:
"due_date_from_milestones": "2018-07-31", "due_date_from_milestones": "2018-07-31",
"created_at": "2018-07-17T13:36:22.770Z", "created_at": "2018-07-17T13:36:22.770Z",
"updated_at": "2018-07-18T12:22:05.239Z", "updated_at": "2018-07-18T12:22:05.239Z",
"closed_at": "2018-08-18T12:22:05.239Z",
"labels": [], "labels": [],
"upvotes": 4, "upvotes": 4,
"downvotes": 0 "downvotes": 0
...@@ -276,6 +279,7 @@ Example response: ...@@ -276,6 +279,7 @@ Example response:
"due_date_from_milestones": "2018-07-31", "due_date_from_milestones": "2018-07-31",
"created_at": "2018-07-17T13:36:22.770Z", "created_at": "2018-07-17T13:36:22.770Z",
"updated_at": "2018-07-18T12:22:05.239Z", "updated_at": "2018-07-18T12:22:05.239Z",
"closed_at": "2018-08-18T12:22:05.239Z",
"labels": [], "labels": [],
"upvotes": 4, "upvotes": 4,
"downvotes": 0 "downvotes": 0
...@@ -358,7 +362,8 @@ Example response: ...@@ -358,7 +362,8 @@ Example response:
"start_date": null, "start_date": null,
"end_date": null, "end_date": null,
"created_at": "2018-01-21T06:21:13.165Z", "created_at": "2018-01-21T06:21:13.165Z",
"updated_at": "2018-01-22T12:41:41.166Z" "updated_at": "2018-01-22T12:41:41.166Z",
"closed_at": "2018-08-18T12:22:05.239Z"
}, },
"target_url": "https://gitlab.example.com/groups/epics/5", "target_url": "https://gitlab.example.com/groups/epics/5",
"body": "Vel voluptas atque dicta mollitia adipisci qui at.", "body": "Vel voluptas atque dicta mollitia adipisci qui at.",
......
---
title: Expose epics closed_at on API
merge_request: 17156
author:
type: changed
...@@ -301,6 +301,7 @@ module EE ...@@ -301,6 +301,7 @@ module EE
end end
expose :created_at expose :created_at
expose :updated_at expose :updated_at
expose :closed_at
expose :labels do |epic| expose :labels do |epic|
# Avoids an N+1 query since labels are preloaded # Avoids an N+1 query since labels are preloaded
epic.labels.map(&:title).sort epic.labels.map(&:title).sort
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
"state": { "type": "string" }, "state": { "type": "string" },
"created_at": { "type": ["string", "null"] }, "created_at": { "type": ["string", "null"] },
"updated_at": { "type": ["string", "null"] }, "updated_at": { "type": ["string", "null"] },
"closed_at": { "type": ["string", "null"] },
"web_edit_url": { "type": "string" }, "web_edit_url": { "type": "string" },
"web_url": { "type": "string" }, "web_url": { "type": "string" },
"reference": { "type": "string" } "reference": { "type": "string" }
......
...@@ -422,6 +422,15 @@ describe API::Epics do ...@@ -422,6 +422,15 @@ describe API::Epics do
expect(response).to match_response_schema('public_api/v4/epic', dir: 'ee') expect(response).to match_response_schema('public_api/v4/epic', dir: 'ee')
end end
it 'exposes closed_at attribute' do
epic.close
get api(url)
expect(response).to match_response_schema('public_api/v4/epic', dir: 'ee')
expect(json_response['closed_at']).to be_present
end
it_behaves_like 'can admin epics' it_behaves_like 'can admin epics'
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment