Skip to content

Commit

Permalink
fix IssueAssign
Browse files Browse the repository at this point in the history
  • Loading branch information
coryb committed Aug 21, 2017
1 parent 19d8686 commit f32cc70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ func (j *Jira) IssueAssign(issue, name string) error {
return err
}
uri := fmt.Sprintf("%s/rest/api/2/issue/%s/assignee", j.Endpoint, issue)
resp, err := j.UA.Post(uri, "application/json", bytes.NewBuffer(encoded))
resp, err := j.UA.Put(uri, "application/json", bytes.NewBuffer(encoded))
if err != nil {
return err
}
Expand Down
7 changes: 4 additions & 3 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ import (
"fmt"
"io"
"io/ioutil"

"github.com/pkg/errors"
)

func readJSON(input io.Reader, data interface{}) error {
content, err := ioutil.ReadAll(input)
if err != nil {
return err
}
if len(content) == 0 {
return nil
}
err = json.Unmarshal(content, data)
if err != nil {
return errors.Wrap(err, fmt.Sprintf("JSON Parse Error: %s from %s", err, content))
return fmt.Errorf("JSON Parse Error: %s from %q", err, content)
}
return nil
}

0 comments on commit f32cc70

Please sign in to comment.