-
-
Notifications
You must be signed in to change notification settings - Fork 471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments are not being added to issues #604
Comments
Hey @andygrunwald, just wanted to check in and see if you had a chance to take a peek at this one? |
@justaugustus Sorry, time is a bit limited at the moment. Great issue description btw. Would it be possible to have a minimalistic code example without the code structure |
Hey @justaugustus, just FYI - I ran into same issue 😜 Some investigation showed that // Comment represents a comment by a person to an issue in Jira.
type Comment struct {
ID string `json:"id,omitempty" structs:"id,omitempty"`
Self string `json:"self,omitempty" structs:"self,omitempty"`
Name string `json:"name,omitempty" structs:"name,omitempty"`
Author User `json:"author,omitempty" structs:"author,omitempty"`
Body string `json:"body,omitempty" structs:"body,omitempty"`
UpdateAuthor User `json:"updateAuthor,omitempty" structs:"updateAuthor,omitempty"`
Updated string `json:"updated,omitempty" structs:"updated,omitempty"`
Created string `json:"created,omitempty" structs:"created,omitempty"`
Visibility CommentVisibility `json:"visibility,omitempty" structs:"visibility,omitempty"`
// A list of comment properties. Optional on create and update.
Properties []EntityProperty `json:"properties,omitempty" structs:"properties,omitempty"`
} I'm definitely no go expert, but it seems like Getting rid of As a workaround you can define custom struct and just make a HTTP using your // I was only interesting in adding a simple comment
type JiraSimpleComment struct {
Body string `json:"body"`
}
apiEndpoint := fmt.Sprintf("rest/api/2/issue/%s/comment", issue.ID)
req, err := client.NewRequest(context.Background(), http.MethodPost, apiEndpoint, comment)
if err != nil {
return err
}
responseComment := new(jira.Comment)
_, err = jr.client.Do(req, responseComment)
if err != nil {
return err
}
// ... Let me know if that helps, cheers! edit: oh, I'm using |
Thanks! |
@andygrunwald — based on @lgecse's testing, it looks like the PR @LaurenceTews fixes this. Could you review #640 when you have a chance? |
What happened?
I maintain a tool,
gh-jira-issue-sync
, which can (one-way) sync issues from GitHub to Jira.Well, sort of.
I'm currently running into problems copying comments from a GitHub issue to its Jira issue.
Here's a snippet of what that failure looks like:
This tool was forked from https://github.com/coreos/issue-sync, which also used
andygrunwald/go-jira
(v1), but was last updated in 2019 (ref: coreos/issue-sync@ea9d009).A few things could be happening:
What did you expect to happen?
Comments are added to issues.
How can we reproduce it (as minimally and precisely as possible)?
The simplest way is probably to run https://github.com/uwu-tools/gh-jira-issue-sync.
Here are some relevant code snippets:
Anything else we need to know?
Thanks for this maintaining this module, @andygrunwald!
It's entirely possible that this is strictly a downstream bug, but I wanted to file this just in case, since I can see you're working on the move to Jira v2/v3 in #489 / https://github.com/andygrunwald/go-jira/milestone/1 / #501.
Here's the downstream tracking issue: uwu-tools/gh-jira-issue-sync#62
Your Environment
Include as many relevant details about the environment you experienced the problem in
go version
): go1.19.4The text was updated successfully, but these errors were encountered: