Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos authored and Carlos committed May 9, 2019
1 parent 7175c0c commit 0c9f7a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cfg/githubfieldmapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ func (m DefaultFieldMapper) MapFields(issue *models.ExtendedGithubIssue) jira.Is
fields.Unknowns[m.Config.GetCompleteFieldKey(GitHubStatus)] = issue.GetState()
fields.Unknowns[m.Config.GetCompleteFieldKey(GitHubReporter)] = issue.User.GetLogin()

strs := make([]string, len(issue.Labels))
githubLabels := make([]string, len(issue.Labels))
for i, v := range issue.Labels {
strs[i] = *v.Name
githubLabels[i] = *v.Name
}
fields.Unknowns[m.Config.GetCompleteFieldKey(GitHubLabels)] = strings.Join(strs, ",")
fields.Unknowns[m.Config.GetCompleteFieldKey(GitHubLabels)] = strings.Join(githubLabels, ",")

fields.Unknowns[m.Config.GetCompleteFieldKey(LastISUpdate)] = time.Now().Format(DateFormat)

Expand Down Expand Up @@ -155,9 +155,9 @@ func (m JsonFieldMapper) GetFieldValue(jIssue *jira.Issue, fieldKey FieldKey) (i

switch fieldKey {
case GitHubID:
result = parsedJson["githubId"]
result = int64(parsedJson["githubId"].(float64))
case GitHubNumber:
result = parsedJson["githubNumber"]
result = int64(parsedJson["githubNumber"].(float64))
case GitHubLabels:
result = parsedJson["githubLabels"]
case GitHubStatus:
Expand All @@ -182,17 +182,17 @@ func (m JsonFieldMapper) MapFields(issue *models.ExtendedGithubIssue) jira.Issue
Unknowns: map[string]interface{}{},
}

githubLabelString := make([]string, len(issue.Labels))
githubLabels := make([]string, len(issue.Labels))
for i, v := range issue.Labels {
githubLabelString[i] = *v.Name
githubLabels[i] = *v.Name
}

data := map[string]interface{}{
"githubId": issue.GetID(),
"githubNumber": issue.GetNumber(),
"githubStatus":issue.GetState(),
"githubReporter": issue.User.GetLogin(),
"githubLabels": githubLabelString,
"githubLabels": strings.Join(githubLabels, ","),
"lastIssueSyncUpdate": time.Now().Format(DateFormat),
}

Expand Down
Binary file modified issue-sync
Binary file not shown.

0 comments on commit 0c9f7a5

Please sign in to comment.