Skip to content

Commit

Permalink
fixed bug where multiple work item types causes wrong number of fields
Browse files Browse the repository at this point in the history
  • Loading branch information
toddconley committed Dec 15, 2015
1 parent 58bcb20 commit 1890f05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions items.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,9 @@ func (item *Item) toJSON(config *Config, writeLink bool) string {
for _, stageDate := range item.StageDates {
data = append(data, stageDate)
}
if len(config.Types) > 1 {
data = append(data, strings.TrimSpace(item.Type))
}
for _, value := range item.Attributes {
data = append(data, strings.TrimSpace(value))
}
Expand Down
8 changes: 7 additions & 1 deletion jira_to_analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"time"
)

const version = "1.0-beta.12"
const version = "1.0-beta.13"

const batchSize = 25
const maxTries = 5
Expand Down Expand Up @@ -179,6 +179,9 @@ func writeCSV(items []*Item, config *Config, fileName string) {
for _, stage := range config.StageNames {
file.WriteString("," + stage)
}
if len(config.Types) > 1 {
file.WriteString(",Type")
}
for _, attr := range config.Attributes {
file.WriteString("," + attr.ColumnName)
}
Expand Down Expand Up @@ -218,6 +221,9 @@ func writeJSON(items []*Item, config *Config, fileName string) {
for _, stage := range config.StageNames {
file.WriteString(",\"" + stage + "\"")
}
if len(config.Types) > 1 {
file.WriteString(",\"Type\"")
}
for _, attr := range config.Attributes {
file.WriteString(",\"" + attr.ColumnName + "\"")
}
Expand Down

0 comments on commit 1890f05

Please sign in to comment.