Skip to content

Commit 3490c03

Browse files
Ben Selbybenmatselby
Ben Selby
authored andcommitted
Slight version changes for 0.4.0
1 parent 571c10a commit 3490c03

File tree

3 files changed

+68
-10
lines changed

3 files changed

+68
-10
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 0.4.0
4+
5+
- Bumped some of the API versions used.
6+
- Introduced the "Person" structure for fields like `CreatedBy` and `AssignedTo`.
7+
38
## 0.3.0
49

510
- Bumped some of the API versions used.

azuredevops/work_items.go

+9-4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ type WorkItem struct {
4040
Fields WorkItemFields `json:"fields"`
4141
}
4242

43+
// Person represents the object coming back from the API.
44+
type Person struct {
45+
DisplayName string `json:"displayName"`
46+
}
47+
4348
// WorkItemFields describes all the fields for a given work item
4449
type WorkItemFields struct {
4550
ID int `json:"System.Id"`
@@ -48,8 +53,8 @@ type WorkItemFields struct {
4853
Type string `json:"System.WorkItemType"`
4954
Points float64 `json:"Microsoft.VSTS.Scheduling.StoryPoints"`
5055
BoardColumn string `json:"System.BoardColumn"`
51-
CreatedBy string `json:"System.CreatedBy"`
52-
AssignedTo string `json:"System.AssignedTo"`
56+
CreatedBy Person `json:"System.CreatedBy"`
57+
AssignedTo Person `json:"System.AssignedTo"`
5358
Tags string `json:"System.Tags"`
5459
TagList []string
5560
}
@@ -79,7 +84,7 @@ func (s *WorkItemsService) GetForIteration(team string, iteration Iteration) ([]
7984
"/_apis/wit/workitems?ids=%s&fields=%s&api-version=%s",
8085
strings.Join(workIds, ","),
8186
strings.Join(fields, ","),
82-
"4.1-preview",
87+
"6.1-preview.3",
8388
)
8489

8590
request, err := s.client.NewRequest("GET", URL, nil)
@@ -104,7 +109,7 @@ func (s *WorkItemsService) GetIdsForIteration(team string, iteration Iteration)
104109
"/%s/_apis/work/teamsettings/iterations/%s/workitems?api-version=%s",
105110
url.PathEscape(team),
106111
iteration.ID,
107-
"4.1-preview",
112+
"6.1-preview.1",
108113
)
109114

110115
request, err := s.client.NewRequest("GET", URL, nil)

azuredevops/work_items_test.go

+54-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,19 @@ const (
2626
"System.State": "New",
2727
"System.Reason": "New backlog item",
2828
"System.CreatedDate": "2014-12-29T20:49:20.77Z",
29-
"System.CreatedBy": "Jamal Hartnett ",
29+
"System.CreatedBy": {
30+
"displayName": "Jamal Hartnett",
31+
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
32+
"_links": {
33+
"avatar": {
34+
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
35+
}
36+
},
37+
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
38+
"uniqueName": "[email protected]",
39+
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
40+
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
41+
},
3042
"System.ChangedDate": "2014-12-29T20:49:20.77Z",
3143
"System.ChangedBy": "Jamal Hartnett ",
3244
"System.Title": "Customer can sign in using their Microsoft Account",
@@ -46,9 +58,33 @@ const (
4658
"System.WorkItemType": "Task",
4759
"System.State": "To Do",
4860
"System.Reason": "New task",
49-
"System.AssignedTo": "Johnnie McLeod ",
61+
"System.AssignedTo": {
62+
"displayName": "Jamal Hartnett",
63+
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
64+
"_links": {
65+
"avatar": {
66+
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
67+
}
68+
},
69+
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
70+
"uniqueName": "[email protected]",
71+
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
72+
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
73+
},
5074
"System.CreatedDate": "2014-12-29T20:49:21.617Z",
51-
"System.CreatedBy": "Jamal Hartnett ",
75+
"System.CreatedBy": {
76+
"displayName": "Jamal Hartnett",
77+
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
78+
"_links": {
79+
"avatar": {
80+
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
81+
}
82+
},
83+
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
84+
"uniqueName": "[email protected]",
85+
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
86+
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
87+
},
5288
"System.ChangedDate": "2014-12-29T20:49:28.74Z",
5389
"System.ChangedBy": "Jamal Hartnett ",
5490
"System.Title": "JavaScript implementation for Microsoft Account",
@@ -69,7 +105,19 @@ const (
69105
"System.State": "To Do",
70106
"System.Reason": "New task",
71107
"System.CreatedDate": "2014-12-29T20:49:22.103Z",
72-
"System.CreatedBy": "Jamal Hartnett ",
108+
"System.CreatedBy": {
109+
"displayName": "Jamal Hartnett",
110+
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
111+
"_links": {
112+
"avatar": {
113+
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
114+
}
115+
},
116+
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
117+
"uniqueName": "[email protected]",
118+
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
119+
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
120+
},
73121
"System.ChangedDate": "2014-12-29T20:49:22.103Z",
74122
"System.ChangedBy": "Jamal Hartnett ",
75123
"System.Title": "Unit Testing for MSA login",
@@ -134,9 +182,9 @@ func TestWorkItems_GetForIteration(t *testing.T) {
134182
{
135183
name: "we get ids and we get iterations",
136184
idsBaseURL: getIdsURL,
137-
actualIdsURL: "/AZURE_DEVOPS_Project/AZURE_DEVOPS_TEAM/_apis/work/teamsettings/iterations/1/workitems?api-version=4.1-preview",
185+
actualIdsURL: "/AZURE_DEVOPS_Project/AZURE_DEVOPS_TEAM/_apis/work/teamsettings/iterations/1/workitems?api-version=6.1-preview.1",
138186
getBaseURL: getURL,
139-
actualGetURL: "/AZURE_DEVOPS_Project/_apis/wit/workitems?ids=1,3&fields=System.Id,System.Title,System.State,System.WorkItemType,Microsoft.VSTS.Scheduling.StoryPoints,System.BoardColumn,System.CreatedBy,System.AssignedTo,System.Tags&api-version=4.1-preview",
187+
actualGetURL: "/AZURE_DEVOPS_Project/_apis/wit/workitems?ids=1,3&fields=System.Id,System.Title,System.State,System.WorkItemType,Microsoft.VSTS.Scheduling.StoryPoints,System.BoardColumn,System.CreatedBy,System.AssignedTo,System.Tags&api-version=6.1-preview.3",
140188
idsResponse: getIdsResponse,
141189
getResponse: getResponse,
142190
expectedWorkItems: 3,

0 commit comments

Comments
 (0)