
๐ฌComments
Get comment attachments
package main
import (
"context"
"github.com/ctreminiom/go-atlassian/jira/sm"
"log"
"os"
)
func main() {
var (
host = os.Getenv("HOST")
mail = os.Getenv("MAIL")
token = os.Getenv("TOKEN")
)
atlassian, err := sm.New(nil, host)
if err != nil {
return
}
atlassian.Auth.SetBasicAuth(mail, token)
atlassian.Auth.SetUserAgent("curl/7.54.0")
atlassian.Auth.SetExperimentalFlag()
var (
issueKeyOrID = "DESK-12"
commentID = 10015
)
attachments, response, err := atlassian.Request.Comment.Attachments(context.Background(), issueKeyOrID, commentID, 0, 50)
if err != nil {
log.Fatal(err)
}
log.Println("Response HTTP Code", response.Code)
log.Println("HTTP Endpoint Used", response.Endpoint)
for _, attachment := range attachments.Values {
log.Println(attachment.Filename, attachment.MimeType, attachment.Size)
}
}Create request comment
Get request comment by id
Get request comments
Last updated
Was this helpful?