Add status column for each projectItem object.
This should be comparable to classic project's notion of column, although not _exactly_ the same since new projects are much more configurable.
This commit is contained in:
parent
bc0f63b043
commit
8a868779a6
4 changed files with 15 additions and 2 deletions
|
|
@ -23,7 +23,8 @@ func (issue *Issue) ExportData(fields []string) map[string]interface{} {
|
|||
items := make([]map[string]interface{}, 0, len(issue.ProjectItems.Nodes))
|
||||
for _, n := range issue.ProjectItems.Nodes {
|
||||
items = append(items, map[string]interface{}{
|
||||
"title": n.Project.Title,
|
||||
"status": n.Status,
|
||||
"title": n.Project.Title,
|
||||
})
|
||||
}
|
||||
data[f] = items
|
||||
|
|
|
|||
|
|
@ -85,6 +85,10 @@ func TestIssue_ExportData(t *testing.T) {
|
|||
"project": {
|
||||
"id": "PVT_id",
|
||||
"title": "Some Project"
|
||||
},
|
||||
"status": {
|
||||
"name": "Todo",
|
||||
"optionId": "abc123"
|
||||
}
|
||||
}
|
||||
] } }
|
||||
|
|
@ -93,6 +97,10 @@ func TestIssue_ExportData(t *testing.T) {
|
|||
{
|
||||
"projectItems": [
|
||||
{
|
||||
"status": {
|
||||
"optionId": "abc123",
|
||||
"name": "Todo"
|
||||
},
|
||||
"title": "Some Project"
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -106,6 +106,10 @@ type ProjectV2Item struct {
|
|||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
Status struct {
|
||||
OptionID string `json:"optionId"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
}
|
||||
|
||||
func (p ProjectCards) ProjectNames() []string {
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ func IssueGraphQL(fields []string) string {
|
|||
case "projectCards":
|
||||
q = append(q, `projectCards(first:100){nodes{project{name}column{name}},totalCount}`)
|
||||
case "projectItems":
|
||||
q = append(q, `projectItems(first:100){nodes{id, project{id,title}},totalCount}`)
|
||||
q = append(q, `projectItems(first:100){nodes{id, project{id,title}, status:fieldValueByName(name: "Status") { ... on ProjectV2ItemFieldSingleSelectValue{optionId,name}}},totalCount}`)
|
||||
case "milestone":
|
||||
q = append(q, `milestone{number,title,description,dueOn}`)
|
||||
case "reactionGroups":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue