Skip to content

Commit

Permalink
Support older versions of Jira server that predate the switch to acco…
Browse files Browse the repository at this point in the history
…unt IDs
  • Loading branch information
kunickiaj committed Jul 26, 2021
1 parent e00f80d commit e63494b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/brew.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func brew(cmd *cobra.Command, args []string) {
"Issue Type": issueType,
"Summary": summary,
"Description": description,
"Assignee": jiraUser.AccountID,
"Assignee": assignee(jiraUser),
}

fields, err := metaIssueType.GetAllFields()
Expand Down Expand Up @@ -240,6 +240,14 @@ func brew(cmd *cobra.Command, args []string) {
}
}

func assignee(jiraUser *jira.User) string {
if len(jiraUser.AccountID) > 0 {
return jiraUser.AccountID
} else {
return jiraUser.Name
}
}

func appendAutomaticMetadata(repo *git.Repository, issue *jira.Issue) *jira.Issue {
if !autoMetadata {
return issue
Expand Down

0 comments on commit e63494b

Please sign in to comment.