Repository: ctreminiom/go-atlassian
Pull request #191 (2023-04-29 00:18:42)

:bug: Added the ability to extract the issue workflow comments based …
…on the Jira version.


Patch:
diff --git a/jira/internal/worklog_impl_adf.go b/jira/internal/worklog_impl_adf.go
index 50e5f91..e0dce52 100644
--- a/jira/internal/worklog_impl_adf.go
+++ b/jira/internal/worklog_impl_adf.go
@@ -34,7 +34,7 @@ type WorklogADFService struct {
 // POST /rest/api/{2-3}/worklog/list
 //
 // https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-worklogs
-func (w *WorklogADFService) Gets(ctx context.Context, worklogIds []int, expand []string) ([]*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (w *WorklogADFService) Gets(ctx context.Context, worklogIds []int, expand []string) ([]*model.IssueWorklogADFScheme, *model.ResponseScheme, error) {
 	return w.internalClient.Gets(ctx, worklogIds, expand)
 }
 
@@ -45,7 +45,7 @@ func (w *WorklogADFService) Gets(ctx context.Context, worklogIds []int, expand [
 // GET /rest/api/{2-3}/issue/{issueIdOrKey}/worklog/{id}
 //
 // https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-worklog
-func (w *WorklogADFService) Get(ctx context.Context, issueKeyOrId, worklogId string, expand []string) (*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (w *WorklogADFService) Get(ctx context.Context, issueKeyOrId, worklogId string, expand []string) (*model.IssueWorklogADFScheme, *model.ResponseScheme, error) {
 	return w.internalClient.Get(ctx, issueKeyOrId, worklogId, expand)
 }
 
@@ -56,7 +56,7 @@ func (w *WorklogADFService) Get(ctx context.Context, issueKeyOrId, worklogId str
 // GET /rest/api/{2-3}/issue/{issueIdOrKey}/worklog
 //
 // https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-issue-worklogs
-func (w *WorklogADFService) Issue(ctx context.Context, issueKeyOrId string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogPageScheme, *model.ResponseScheme, error) {
+func (w *WorklogADFService) Issue(ctx context.Context, issueKeyOrId string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogADFPageScheme, *model.ResponseScheme, error) {
 	return w.internalClient.Issue(ctx, issueKeyOrId, startAt, maxResults, after, expand)
 }
 
@@ -110,7 +110,7 @@ func (w *WorklogADFService) Updated(ctx context.Context, since int, expand []str
 // POST /rest/api/3/issue/{issueIdOrKey}/worklog
 //
 // https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#add-worklog
-func (w *WorklogADFService) Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogPayloadSchemeV3, options *model.WorklogOptionsScheme) (*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (w *WorklogADFService) Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogADFPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogADFScheme, *model.ResponseScheme, error) {
 	return w.internalClient.Add(ctx, issueKeyOrID, payload, options)
 }
 
@@ -121,7 +121,7 @@ func (w *WorklogADFService) Add(ctx context.Context, issueKeyOrID string, payloa
 // PUT /rest/api/3/issue/{issueIdOrKey}/worklog/{id}
 //
 // https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#update-worklog
-func (w *WorklogADFService) Update(ctx context.Context, issueKeyOrId, worklogId string, payload *model.WorklogPayloadSchemeV3, options *model.WorklogOptionsScheme) (*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (w *WorklogADFService) Update(ctx context.Context, issueKeyOrId, worklogId string, payload *model.WorklogADFPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogADFScheme, *model.ResponseScheme, error) {
 	return w.internalClient.Update(ctx, issueKeyOrId, worklogId, payload, options)
 }
 
@@ -130,7 +130,7 @@ type internalWorklogAdfImpl struct {
 	version string
 }
 
-func (i *internalWorklogAdfImpl) Gets(ctx context.Context, worklogIds []int, expand []string) ([]*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (i *internalWorklogAdfImpl) Gets(ctx context.Context, worklogIds []int, expand []string) ([]*model.IssueWorklogADFScheme, *model.ResponseScheme, error) {
 
 	if len(worklogIds) == 0 {
 		return nil, nil, model.ErrNpWorklogsError
@@ -164,7 +164,7 @@ func (i *internalWorklogAdfImpl) Gets(ctx context.Context, worklogIds []int, exp
 		return nil, nil, err
 	}
 
-	var worklogs []*model.IssueWorklogScheme
+	var worklogs []*model.IssueWorklogADFScheme
 	response, err := i.c.Call(request, &worklogs)
 	if err != nil {
 		return nil, response, err
@@ -173,7 +173,7 @@ func (i *internalWorklogAdfImpl) Gets(ctx context.Context, worklogIds []int, exp
 	return worklogs, response, nil
 }
 
-func (i *internalWorklogAdfImpl) Get(ctx context.Context, issueKeyOrId, worklogId string, expand []string) (*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (i *internalWorklogAdfImpl) Get(ctx context.Context, issueKeyOrId, worklogId string, expand []string) (*model.IssueWorklogADFScheme, *model.ResponseScheme, error) {
 
 	if issueKeyOrId == "" {
 		return nil, nil, model.ErrNoIssueKeyOrIDError
@@ -200,7 +200,7 @@ func (i *internalWorklogAdfImpl) Get(ctx context.Context, issueKeyOrId, worklogI
 		return nil, nil, err
 	}
 
-	worklog := new(model.IssueWorklogScheme)
+	worklog := new(model.IssueWorklogADFScheme)
 	response, err := i.c.Call(request, worklog)
 	if err != nil {
 		return nil, response, err
@@ -209,7 +209,7 @@ func (i *internalWorklogAdfImpl) Get(ctx context.Context, issueKeyOrId, worklogI
 	return worklog, response, nil
 }
 
-func (i *internalWorklogAdfImpl) Issue(ctx context.Context, issueKeyOrId string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogPageScheme, *model.ResponseScheme, error) {
+func (i *internalWorklogAdfImpl) Issue(ctx context.Context, issueKeyOrId string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogADFPageScheme, *model.ResponseScheme, error) {
 
 	if issueKeyOrId == "" {
 		return nil, nil, model.ErrNoIssueKeyOrIDError
@@ -234,7 +234,7 @@ func (i *internalWorklogAdfImpl) Issue(ctx context.Context, issueKeyOrId string,
 		return nil, nil, err
 	}
 
-	worklogs := new(model.IssueWorklogPageScheme)
+	worklogs := new(model.IssueWorklogADFPageScheme)
 	response, err := i.c.Call(request, worklogs)
 	if err != nil {
 		return nil, response, err
@@ -349,7 +349,7 @@ func (i *internalWorklogAdfImpl) Updated(ctx context.Context, since int, expand
 	return worklogs, response, nil
 }
 
-func (i *internalWorklogAdfImpl) Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogPayloadSchemeV3, options *model.WorklogOptionsScheme) (*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (i *internalWorklogAdfImpl) Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogADFPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogADFScheme, *model.ResponseScheme, error) {
 
 	if issueKeyOrID == "" {
 		return nil, nil, model.ErrNoIssueKeyOrIDError
@@ -394,7 +394,7 @@ func (i *internalWorklogAdfImpl) Add(ctx context.Context, issueKeyOrID string, p
 		return nil, nil, err
 	}
 
-	worklog := new(model.IssueWorklogScheme)
+	worklog := new(model.IssueWorklogADFScheme)
 	response, err := i.c.Call(request, worklog)
 	if err != nil {
 		return nil, response, err
@@ -403,7 +403,7 @@ func (i *internalWorklogAdfImpl) Add(ctx context.Context, issueKeyOrID string, p
 	return worklog, response, nil
 }
 
-func (i *internalWorklogAdfImpl) Update(ctx context.Context, issueKeyOrId, worklogId string, payload *model.WorklogPayloadSchemeV3, options *model.WorklogOptionsScheme) (*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (i *internalWorklogAdfImpl) Update(ctx context.Context, issueKeyOrId, worklogId string, payload *model.WorklogADFPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogADFScheme, *model.ResponseScheme, error) {
 
 	if issueKeyOrId == "" {
 		return nil, nil, model.ErrNoIssueKeyOrIDError
@@ -452,7 +452,7 @@ func (i *internalWorklogAdfImpl) Update(ctx context.Context, issueKeyOrId, workl
 		return nil, nil, err
 	}
 
-	worklog := new(model.IssueWorklogScheme)
+	worklog := new(model.IssueWorklogADFScheme)
 	response, err := i.c.Call(request, worklog)
 	if err != nil {
 		return nil, response, err
diff --git a/jira/internal/worklog_impl_rich_text.go b/jira/internal/worklog_impl_rich_text.go
index 71d7dad..4df9ecc 100644
--- a/jira/internal/worklog_impl_rich_text.go
+++ b/jira/internal/worklog_impl_rich_text.go
@@ -34,7 +34,7 @@ type WorklogRichTextService struct {
 // POST /rest/api/{2-3}/worklog/list
 //
 // https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-worklogs
-func (w *WorklogRichTextService) Gets(ctx context.Context, worklogIds []int, expand []string) ([]*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (w *WorklogRichTextService) Gets(ctx context.Context, worklogIds []int, expand []string) ([]*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error) {
 	return w.internalClient.Gets(ctx, worklogIds, expand)
 }
 
@@ -45,7 +45,7 @@ func (w *WorklogRichTextService) Gets(ctx context.Context, worklogIds []int, exp
 // GET /rest/api/{2-3}/issue/{issueIdOrKey}/worklog/{id}
 //
 // https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-worklog
-func (w *WorklogRichTextService) Get(ctx context.Context, issueKeyOrId, worklogId string, expand []string) (*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (w *WorklogRichTextService) Get(ctx context.Context, issueKeyOrId, worklogId string, expand []string) (*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error) {
 	return w.internalClient.Get(ctx, issueKeyOrId, worklogId, expand)
 }
 
@@ -56,7 +56,7 @@ func (w *WorklogRichTextService) Get(ctx context.Context, issueKeyOrId, worklogI
 // GET /rest/api/{2-3}/issue/{issueIdOrKey}/worklog
 //
 // https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-issue-worklogs
-func (w *WorklogRichTextService) Issue(ctx context.Context, issueKeyOrId string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogPageScheme, *model.ResponseScheme, error) {
+func (w *WorklogRichTextService) Issue(ctx context.Context, issueKeyOrId string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogRichTextPageScheme, *model.ResponseScheme, error) {
 	return w.internalClient.Issue(ctx, issueKeyOrId, startAt, maxResults, after, expand)
 }
 
@@ -110,7 +110,7 @@ func (w *WorklogRichTextService) Updated(ctx context.Context, since int, expand
 // POST /rest/api/2/issue/{issueIdOrKey}/worklog
 //
 // https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#add-worklog
-func (w *WorklogRichTextService) Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogPayloadSchemeV2, options *model.WorklogOptionsScheme) (*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (w *WorklogRichTextService) Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogRichTextPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error) {
 	return w.internalClient.Add(ctx, issueKeyOrID, payload, options)
 }
 
@@ -121,7 +121,7 @@ func (w *WorklogRichTextService) Add(ctx context.Context, issueKeyOrID string, p
 // PUT /rest/api/2/issue/{issueIdOrKey}/worklog/{id}
 //
 // https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#update-worklog
-func (w *WorklogRichTextService) Update(ctx context.Context, issueKeyOrId, worklogId string, payload *model.WorklogPayloadSchemeV2, options *model.WorklogOptionsScheme) (*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (w *WorklogRichTextService) Update(ctx context.Context, issueKeyOrId, worklogId string, payload *model.WorklogRichTextPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error) {
 	return w.internalClient.Update(ctx, issueKeyOrId, worklogId, payload, options)
 }
 
@@ -130,7 +130,7 @@ type internalWorklogRichTextImpl struct {
 	version string
 }
 
-func (i *internalWorklogRichTextImpl) Gets(ctx context.Context, worklogIds []int, expand []string) ([]*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (i *internalWorklogRichTextImpl) Gets(ctx context.Context, worklogIds []int, expand []string) ([]*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error) {
 
 	if len(worklogIds) == 0 {
 		return nil, nil, model.ErrNpWorklogsError
@@ -164,7 +164,7 @@ func (i *internalWorklogRichTextImpl) Gets(ctx context.Context, worklogIds []int
 		return nil, nil, err
 	}
 
-	var worklogs []*model.IssueWorklogScheme
+	var worklogs []*model.IssueWorklogRichTextScheme
 	response, err := i.c.Call(request, &worklogs)
 	if err != nil {
 		return nil, response, err
@@ -173,7 +173,7 @@ func (i *internalWorklogRichTextImpl) Gets(ctx context.Context, worklogIds []int
 	return worklogs, response, nil
 }
 
-func (i *internalWorklogRichTextImpl) Get(ctx context.Context, issueKeyOrId, worklogId string, expand []string) (*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (i *internalWorklogRichTextImpl) Get(ctx context.Context, issueKeyOrId, worklogId string, expand []string) (*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error) {
 
 	if issueKeyOrId == "" {
 		return nil, nil, model.ErrNoIssueKeyOrIDError
@@ -200,7 +200,7 @@ func (i *internalWorklogRichTextImpl) Get(ctx context.Context, issueKeyOrId, wor
 		return nil, nil, err
 	}
 
-	worklog := new(model.IssueWorklogScheme)
+	worklog := new(model.IssueWorklogRichTextScheme)
 	response, err := i.c.Call(request, worklog)
 	if err != nil {
 		return nil, response, err
@@ -209,7 +209,7 @@ func (i *internalWorklogRichTextImpl) Get(ctx context.Context, issueKeyOrId, wor
 	return worklog, response, nil
 }
 
-func (i *internalWorklogRichTextImpl) Issue(ctx context.Context, issueKeyOrId string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogPageScheme, *model.ResponseScheme, error) {
+func (i *internalWorklogRichTextImpl) Issue(ctx context.Context, issueKeyOrId string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogRichTextPageScheme, *model.ResponseScheme, error) {
 
 	if issueKeyOrId == "" {
 		return nil, nil, model.ErrNoIssueKeyOrIDError
@@ -234,7 +234,7 @@ func (i *internalWorklogRichTextImpl) Issue(ctx context.Context, issueKeyOrId st
 		return nil, nil, err
 	}
 
-	worklogs := new(model.IssueWorklogPageScheme)
+	worklogs := new(model.IssueWorklogRichTextPageScheme)
 	response, err := i.c.Call(request, worklogs)
 	if err != nil {
 		return nil, response, err
@@ -349,7 +349,7 @@ func (i *internalWorklogRichTextImpl) Updated(ctx context.Context, since int, ex
 	return worklogs, response, nil
 }
 
-func (i *internalWorklogRichTextImpl) Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogPayloadSchemeV2, options *model.WorklogOptionsScheme) (*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (i *internalWorklogRichTextImpl) Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogRichTextPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error) {
 
 	if issueKeyOrID == "" {
 		return nil, nil, model.ErrNoIssueKeyOrIDError
@@ -394,7 +394,7 @@ func (i *internalWorklogRichTextImpl) Add(ctx context.Context, issueKeyOrID stri
 		return nil, nil, err
 	}
 
-	worklog := new(model.IssueWorklogScheme)
+	worklog := new(model.IssueWorklogRichTextScheme)
 	response, err := i.c.Call(request, worklog)
 	if err != nil {
 		return nil, response, err
@@ -403,7 +403,7 @@ func (i *internalWorklogRichTextImpl) Add(ctx context.Context, issueKeyOrID stri
 	return worklog, response, nil
 }
 
-func (i *internalWorklogRichTextImpl) Update(ctx context.Context, issueKeyOrId, worklogId string, payload *model.WorklogPayloadSchemeV2, options *model.WorklogOptionsScheme) (*model.IssueWorklogScheme, *model.ResponseScheme, error) {
+func (i *internalWorklogRichTextImpl) Update(ctx context.Context, issueKeyOrId, worklogId string, payload *model.WorklogRichTextPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error) {
 
 	if issueKeyOrId == "" {
 		return nil, nil, model.ErrNoIssueKeyOrIDError
@@ -452,7 +452,7 @@ func (i *internalWorklogRichTextImpl) Update(ctx context.Context, issueKeyOrId,
 		return nil, nil, err
 	}
 
-	worklog := new(model.IssueWorklogScheme)
+	worklog := new(model.IssueWorklogRichTextScheme)
 	response, err := i.c.Call(request, worklog)
 	if err != nil {
 		return nil, response, err
diff --git a/pkg/infra/models/jira_work_log.go b/pkg/infra/models/jira_work_log.go
index 6c062ea..22c806a 100644
--- a/pkg/infra/models/jira_work_log.go
+++ b/pkg/infra/models/jira_work_log.go
@@ -9,7 +9,7 @@ type WorklogOptionsScheme struct {
 	Expand               []string
 }
 
-type WorklogPayloadSchemeV3 struct {
+type WorklogADFPayloadScheme struct {
 	Comment          *CommentNodeScheme            `json:"comment,omitempty"`
 	Visibility       *IssueWorklogVisibilityScheme `json:"visibility,omitempty"`
 	Started          string                        `json:"started,omitempty"`
@@ -17,7 +17,7 @@ type WorklogPayloadSchemeV3 struct {
 	TimeSpentSeconds int                           `json:"timeSpentSeconds,omitempty"`
 }
 
-type WorklogPayloadSchemeV2 struct {
+type WorklogRichTextPayloadScheme struct {
 	Comment          *CommentPayloadSchemeV2       `json:"comment,omitempty"`
 	Visibility       *IssueWorklogVisibilityScheme `json:"visibility,omitempty"`
 	Started          string                        `json:"started,omitempty"`
@@ -44,18 +44,31 @@ type ChangedWorklogPropertyScheme struct {
 	Key string `json:"key,omitempty"`
 }
 
-type IssueWorklogPageScheme struct {
-	StartAt    int                   `json:"startAt,omitempty"`
-	MaxResults int                   `json:"maxResults,omitempty"`
-	Total      int                   `json:"total,omitempty"`
-	Worklogs   []*IssueWorklogScheme `json:"worklogs,omitempty"`
+type IssueWorklogRichTextPageScheme struct {
+	StartAt    int                           `json:"startAt,omitempty"`
+	MaxResults int                           `json:"maxResults,omitempty"`
+	Total      int                           `json:"total,omitempty"`
+	Worklogs   []*IssueWorklogRichTextScheme `json:"worklogs,omitempty"`
 }
 
-type IssueWorklogScheme struct {
+type IssueWorklogADFPageScheme struct {
+	StartAt    int                      `json:"startAt,omitempty"`
+	MaxResults int                      `json:"maxResults,omitempty"`
+	Total      int                      `json:"total,omitempty"`
+	Worklogs   []*IssueWorklogADFScheme `json:"worklogs,omitempty"`
+}
+
+type IssueWorklogVisibilityScheme struct {
+	Type       string `json:"type,omitempty"`
+	Value      string `json:"value,omitempty"`
+	Identifier string `json:"identifier,omitempty"`
+}
+
+type IssueWorklogRichTextScheme struct {
 	Self             string                        `json:"self,omitempty"`
 	Author           *UserDetailScheme             `json:"author,omitempty"`
 	UpdateAuthor     *UserDetailScheme             `json:"updateAuthor,omitempty"`
-	Created          string                        `json:"created,omitempty"`
+	Comment          string                        `json:"comment,omitempty"`
 	Updated          string                        `json:"updated,omitempty"`
 	Visibility       *IssueWorklogVisibilityScheme `json:"visibility,omitempty"`
 	Started          string                        `json:"started,omitempty"`
@@ -65,7 +78,16 @@ type IssueWorklogScheme struct {
 	IssueID          string                        `json:"issueId,omitempty"`
 }
 
-type IssueWorklogVisibilityScheme struct {
-	Type  string `json:"type,omitempty"`
-	Value string `json:"value,omitempty"`
+type IssueWorklogADFScheme struct {
+	Self             string                        `json:"self,omitempty"`
+	Author           *UserDetailScheme             `json:"author,omitempty"`
+	UpdateAuthor     *UserDetailScheme             `json:"updateAuthor,omitempty"`
+	Comment          *CommentNodeScheme            `json:"comment,omitempty"`
+	Updated          string                        `json:"updated,omitempty"`
+	Visibility       *IssueWorklogVisibilityScheme `json:"visibility,omitempty"`
+	Started          string                        `json:"started,omitempty"`
+	TimeSpent        string                        `json:"timeSpent,omitempty"`
+	TimeSpentSeconds int                           `json:"timeSpentSeconds,omitempty"`
+	ID               string                        `json:"id,omitempty"`
+	IssueID          string                        `json:"issueId,omitempty"`
 }
diff --git a/service/jira/worklog.go b/service/jira/worklog.go
index 40a4ef9..a7fdbfe 100644
--- a/service/jira/worklog.go
+++ b/service/jira/worklog.go
@@ -7,33 +7,6 @@ import (
 
 type WorklogSharedConnector interface {
 
-	// Gets returns worklog details for a list of worklog IDs.
-	//
-	// The returned list of worklogs is limited to 1000 items.
-	//
-	// POST /rest/api/{2-3}/worklog/list
-	//
-	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-worklogs
-	Gets(ctx context.Context, worklogIds []int, expand []string) ([]*model.IssueWorklogScheme, *model.ResponseScheme, error)
-
-	// Get returns a worklog.
-	//
-	// Time tracking must be enabled in Jira, otherwise this operation returns an error.
-	//
-	// GET /rest/api/{2-3}/issue/{issueIdOrKey}/worklog/{id}
-	//
-	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-worklog
-	Get(ctx context.Context, issueKeyOrId, worklogId string, expand []string) (*model.IssueWorklogScheme, *model.ResponseScheme, error)
-
-	// Issue returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and time.
-	//
-	// Time tracking must be enabled in Jira, otherwise this operation returns an error.
-	//
-	// GET /rest/api/{2-3}/issue/{issueIdOrKey}/worklog
-	//
-	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-issue-worklogs
-	Issue(ctx context.Context, issueKeyOrId string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogPageScheme, *model.ResponseScheme, error)
-
 	// Delete deletes a worklog from an issue.
 	//
 	// Time tracking must be enabled in Jira, otherwise this operation returns an error.
@@ -75,6 +48,33 @@ type WorklogSharedConnector interface {
 type WorklogRichTextConnector interface {
 	WorklogSharedConnector
 
+	// Gets returns worklog details for a list of worklog IDs.
+	//
+	// The returned list of worklogs is limited to 1000 items.
+	//
+	// POST /rest/api/{2-3}/worklog/list
+	//
+	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-worklogs
+	Gets(ctx context.Context, worklogIds []int, expand []string) ([]*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error)
+
+	// Get returns a worklog.
+	//
+	// Time tracking must be enabled in Jira, otherwise this operation returns an error.
+	//
+	// GET /rest/api/{2-3}/issue/{issueIdOrKey}/worklog/{id}
+	//
+	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-worklog
+	Get(ctx context.Context, issueKeyOrId, worklogId string, expand []string) (*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error)
+
+	// Issue returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and time.
+	//
+	// Time tracking must be enabled in Jira, otherwise this operation returns an error.
+	//
+	// GET /rest/api/{2-3}/issue/{issueIdOrKey}/worklog
+	//
+	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-issue-worklogs
+	Issue(ctx context.Context, issueKeyOrId string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogRichTextPageScheme, *model.ResponseScheme, error)
+
 	// Add adds a worklog to an issue.
 	//
 	// Time tracking must be enabled in Jira, otherwise this operation returns an error.
@@ -82,7 +82,7 @@ type WorklogRichTextConnector interface {
 	// POST /rest/api/2/issue/{issueIdOrKey}/worklog
 	//
 	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#add-worklog
-	Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogPayloadSchemeV2, options *model.WorklogOptionsScheme) (*model.IssueWorklogScheme,
+	Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogRichTextPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogRichTextScheme,
 		*model.ResponseScheme, error)
 
 	// Update updates a worklog.
@@ -92,13 +92,40 @@ type WorklogRichTextConnector interface {
 	// PUT /rest/api/2/issue/{issueIdOrKey}/worklog/{id}
 	//
 	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#update-worklog
-	Update(ctx context.Context, issueKeyOrId, worklogId string, payload *model.WorklogPayloadSchemeV2, options *model.WorklogOptionsScheme) (
-		*model.IssueWorklogScheme, *model.ResponseScheme, error)
+	Update(ctx context.Context, issueKeyOrId, worklogId string, payload *model.WorklogRichTextPayloadScheme, options *model.WorklogOptionsScheme) (
+		*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error)
 }
 
 type WorklogADFConnector interface {
 	WorklogSharedConnector
 
+	// Gets returns worklog details for a list of worklog IDs.
+	//
+	// The returned list of worklogs is limited to 1000 items.
+	//
+	// POST /rest/api/{2-3}/worklog/list
+	//
+	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-worklogs
+	Gets(ctx context.Context, worklogIds []int, expand []string) ([]*model.IssueWorklogADFScheme, *model.ResponseScheme, error)
+
+	// Get returns a worklog.
+	//
+	// Time tracking must be enabled in Jira, otherwise this operation returns an error.
+	//
+	// GET /rest/api/{2-3}/issue/{issueIdOrKey}/worklog/{id}
+	//
+	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-worklog
+	Get(ctx context.Context, issueKeyOrId, worklogId string, expand []string) (*model.IssueWorklogADFScheme, *model.ResponseScheme, error)
+
+	// Issue returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and time.
+	//
+	// Time tracking must be enabled in Jira, otherwise this operation returns an error.
+	//
+	// GET /rest/api/{2-3}/issue/{issueIdOrKey}/worklog
+	//
+	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#get-issue-worklogs
+	Issue(ctx context.Context, issueKeyOrId string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogADFPageScheme, *model.ResponseScheme, error)
+
 	// Add adds a worklog to an issue.
 	//
 	// Time tracking must be enabled in Jira, otherwise this operation returns an error.
@@ -106,7 +133,7 @@ type WorklogADFConnector interface {
 	// POST /rest/api/3/issue/{issueIdOrKey}/worklog
 	//
 	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#add-worklog
-	Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogPayloadSchemeV3, options *model.WorklogOptionsScheme) (*model.IssueWorklogScheme,
+	Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogADFPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogADFScheme,
 		*model.ResponseScheme, error)
 
 	// Update updates a worklog.
@@ -116,6 +143,6 @@ type WorklogADFConnector interface {
 	// PUT /rest/api/3/issue/{issueIdOrKey}/worklog/{id}
 	//
 	// https://docs.go-atlassian.io/jira-software-cloud/issues/worklogs#update-worklog
-	Update(ctx context.Context, issueKeyOrId, worklogId string, payload *model.WorklogPayloadSchemeV3, options *model.WorklogOptionsScheme) (
-		*model.IssueWorklogScheme, *model.ResponseScheme, error)
+	Update(ctx context.Context, issueKeyOrId, worklogId string, payload *model.WorklogADFPayloadScheme, options *model.WorklogOptionsScheme) (
+		*model.IssueWorklogADFScheme, *model.ResponseScheme, error)
 }


Test patch:
diff --git a/jira/internal/worklog_impl_adf_test.go b/jira/internal/worklog_impl_adf_test.go
index 4927145..275d08b 100644
--- a/jira/internal/worklog_impl_adf_test.go
+++ b/jira/internal/worklog_impl_adf_test.go
@@ -220,7 +220,7 @@ func Test_internalWorklogAdfImpl_Get(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogScheme{}).
+					&model.IssueWorklogADFScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -251,7 +251,7 @@ func Test_internalWorklogAdfImpl_Get(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogScheme{}).
+					&model.IssueWorklogADFScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -385,7 +385,7 @@ func Test_internalWorklogAdfImpl_Issue(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogPageScheme{}).
+					&model.IssueWorklogADFPageScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -418,7 +418,7 @@ func Test_internalWorklogAdfImpl_Issue(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogPageScheme{}).
+					&model.IssueWorklogADFPageScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -992,7 +992,7 @@ func Test_internalWorklogAdfImpl_Add(t *testing.T) {
 		},
 	})
 
-	payloadMocked := &model.WorklogPayloadSchemeV3{
+	payloadMocked := &model.WorklogADFPayloadScheme{
 		Comment: worklogCommentMocked,
 		Visibility: &model.IssueWorklogVisibilityScheme{
 			Type:  "group",
@@ -1011,7 +1011,7 @@ func Test_internalWorklogAdfImpl_Add(t *testing.T) {
 	type args struct {
 		ctx          context.Context
 		issueKeyOrID string
-		payload      *model.WorklogPayloadSchemeV3
+		payload      *model.WorklogADFPayloadScheme
 		options      *model.WorklogOptionsScheme
 	}
 
@@ -1056,7 +1056,7 @@ func Test_internalWorklogAdfImpl_Add(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogScheme{}).
+					&model.IssueWorklogADFScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -1098,7 +1098,7 @@ func Test_internalWorklogAdfImpl_Add(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogScheme{}).
+					&model.IssueWorklogADFScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -1120,7 +1120,7 @@ func Test_internalWorklogAdfImpl_Add(t *testing.T) {
 				client := mocks.NewClient(t)
 
 				client.On("TransformStructToReader",
-					(*model.WorklogPayloadSchemeV3)(nil)).
+					(*model.WorklogADFPayloadScheme)(nil)).
 					Return(bytes.NewReader([]byte{}), model.ErrNonPayloadPointerError)
 
 				fields.c = client
@@ -1216,7 +1216,7 @@ func Test_internalWorklogAdfImpl_Update(t *testing.T) {
 		},
 	})
 
-	payloadMocked := &model.WorklogPayloadSchemeV3{
+	payloadMocked := &model.WorklogADFPayloadScheme{
 		Comment: worklogCommentMocked,
 		Visibility: &model.IssueWorklogVisibilityScheme{
 			Type:  "group",
@@ -1235,7 +1235,7 @@ func Test_internalWorklogAdfImpl_Update(t *testing.T) {
 	type args struct {
 		ctx                     context.Context
 		issueKeyOrID, worklogId string
-		payload                 *model.WorklogPayloadSchemeV3
+		payload                 *model.WorklogADFPayloadScheme
 		options                 *model.WorklogOptionsScheme
 	}
 
@@ -1281,7 +1281,7 @@ func Test_internalWorklogAdfImpl_Update(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogScheme{}).
+					&model.IssueWorklogADFScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -1324,7 +1324,7 @@ func Test_internalWorklogAdfImpl_Update(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogScheme{}).
+					&model.IssueWorklogADFScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -1368,7 +1368,7 @@ func Test_internalWorklogAdfImpl_Update(t *testing.T) {
 				client := mocks.NewClient(t)
 
 				client.On("TransformStructToReader",
-					(*model.WorklogPayloadSchemeV3)(nil)).
+					(*model.WorklogADFPayloadScheme)(nil)).
 					Return(bytes.NewReader([]byte{}), model.ErrNonPayloadPointerError)
 
 				fields.c = client
diff --git a/jira/internal/worklog_impl_rich_text_test.go b/jira/internal/worklog_impl_rich_text_test.go
index f348578..0e9c328 100644
--- a/jira/internal/worklog_impl_rich_text_test.go
+++ b/jira/internal/worklog_impl_rich_text_test.go
@@ -220,7 +220,7 @@ func Test_internalWorklogRichTextImpl_Get(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogScheme{}).
+					&model.IssueWorklogRichTextScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -251,7 +251,7 @@ func Test_internalWorklogRichTextImpl_Get(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogScheme{}).
+					&model.IssueWorklogRichTextScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -385,7 +385,7 @@ func Test_internalWorklogRichTextImpl_Issue(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogPageScheme{}).
+					&model.IssueWorklogRichTextPageScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -418,7 +418,7 @@ func Test_internalWorklogRichTextImpl_Issue(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogPageScheme{}).
+					&model.IssueWorklogRichTextPageScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -977,7 +977,7 @@ func Test_internalWorklogRichTextImpl_Updated(t *testing.T) {
 
 func Test_internalWorklogRichTextImpl_Add(t *testing.T) {
 
-	payloadMocked := &model.WorklogPayloadSchemeV2{
+	payloadMocked := &model.WorklogRichTextPayloadScheme{
 		Comment: &model.CommentPayloadSchemeV2{
 			Body: "Hello!!",
 		},
@@ -998,7 +998,7 @@ func Test_internalWorklogRichTextImpl_Add(t *testing.T) {
 	type args struct {
 		ctx          context.Context
 		issueKeyOrID string
-		payload      *model.WorklogPayloadSchemeV2
+		payload      *model.WorklogRichTextPayloadScheme
 		options      *model.WorklogOptionsScheme
 	}
 
@@ -1043,7 +1043,7 @@ func Test_internalWorklogRichTextImpl_Add(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogScheme{}).
+					&model.IssueWorklogRichTextScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -1085,7 +1085,7 @@ func Test_internalWorklogRichTextImpl_Add(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogScheme{}).
+					&model.IssueWorklogRichTextScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -1107,7 +1107,7 @@ func Test_internalWorklogRichTextImpl_Add(t *testing.T) {
 				client := mocks.NewClient(t)
 
 				client.On("TransformStructToReader",
-					(*model.WorklogPayloadSchemeV2)(nil)).
+					(*model.WorklogRichTextPayloadScheme)(nil)).
 					Return(bytes.NewReader([]byte{}), model.ErrNonPayloadPointerError)
 
 				fields.c = client
@@ -1188,7 +1188,7 @@ func Test_internalWorklogRichTextImpl_Add(t *testing.T) {
 
 func Test_internalWorklogRichTextImpl_Update(t *testing.T) {
 
-	payloadMocked := &model.WorklogPayloadSchemeV2{
+	payloadMocked := &model.WorklogRichTextPayloadScheme{
 		Comment: nil,
 		Visibility: &model.IssueWorklogVisibilityScheme{
 			Type:  "group",
@@ -1207,7 +1207,7 @@ func Test_internalWorklogRichTextImpl_Update(t *testing.T) {
 	type args struct {
 		ctx                     context.Context
 		issueKeyOrID, worklogId string
-		payload                 *model.WorklogPayloadSchemeV2
+		payload                 *model.WorklogRichTextPayloadScheme
 		options                 *model.WorklogOptionsScheme
 	}
 
@@ -1253,7 +1253,7 @@ func Test_internalWorklogRichTextImpl_Update(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogScheme{}).
+					&model.IssueWorklogRichTextScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -1296,7 +1296,7 @@ func Test_internalWorklogRichTextImpl_Update(t *testing.T) {
 
 				client.On("Call",
 					&http.Request{},
-					&model.IssueWorklogScheme{}).
+					&model.IssueWorklogRichTextScheme{}).
 					Return(&model.ResponseScheme{}, nil)
 
 				fields.c = client
@@ -1340,7 +1340,7 @@ func Test_internalWorklogRichTextImpl_Update(t *testing.T) {
 				client := mocks.NewClient(t)
 
 				client.On("TransformStructToReader",
-					(*model.WorklogPayloadSchemeV2)(nil)).
+					(*model.WorklogRichTextPayloadScheme)(nil)).
 					Return(bytes.NewReader([]byte{}), model.ErrNonPayloadPointerError)
 
 				fields.c = client