Skip to content

Commit

Permalink
✨ Added the ability to manipulates de Issue Properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctreminiom committed Dec 7, 2023
1 parent 9e23f15 commit 8901de1
Show file tree
Hide file tree
Showing 16 changed files with 418 additions and 52 deletions.
50 changes: 25 additions & 25 deletions jira/internal/attachment_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func Test_internalIssueAttachmentServiceImpl_Settings(t *testing.T) {
name: "when the api version is v2",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
},
on: func(fields *fields) {

Expand Down Expand Up @@ -66,7 +66,7 @@ func Test_internalIssueAttachmentServiceImpl_Settings(t *testing.T) {
name: "when the api version is v3",
fields: fields{version: "3"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
},
on: func(fields *fields) {

Expand Down Expand Up @@ -94,7 +94,7 @@ func Test_internalIssueAttachmentServiceImpl_Settings(t *testing.T) {
name: "when the http request cannot be created",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
},
on: func(fields *fields) {

Expand Down Expand Up @@ -171,7 +171,7 @@ func Test_internalIssueAttachmentServiceImpl_Metadata(t *testing.T) {
name: "when the api version is v2",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "1110",
},
on: func(fields *fields) {
Expand Down Expand Up @@ -199,7 +199,7 @@ func Test_internalIssueAttachmentServiceImpl_Metadata(t *testing.T) {
name: "when the api version is v3",
fields: fields{version: "3"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "1110",
},
on: func(fields *fields) {
Expand Down Expand Up @@ -228,7 +228,7 @@ func Test_internalIssueAttachmentServiceImpl_Metadata(t *testing.T) {
name: "when the attachment id is not provided",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "",
},
on: func(fields *fields) {
Expand All @@ -242,7 +242,7 @@ func Test_internalIssueAttachmentServiceImpl_Metadata(t *testing.T) {
name: "when the http request cannot be created",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "1110",
},
on: func(fields *fields) {
Expand Down Expand Up @@ -320,7 +320,7 @@ func Test_internalIssueAttachmentServiceImpl_Human(t *testing.T) {
name: "when the api version is v2",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "1110",
},
on: func(fields *fields) {
Expand Down Expand Up @@ -348,7 +348,7 @@ func Test_internalIssueAttachmentServiceImpl_Human(t *testing.T) {
name: "when the api version is v3",
fields: fields{version: "3"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "1110",
},
on: func(fields *fields) {
Expand Down Expand Up @@ -377,7 +377,7 @@ func Test_internalIssueAttachmentServiceImpl_Human(t *testing.T) {
name: "when the attachment id is not provided",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "",
},
on: func(fields *fields) {
Expand All @@ -391,7 +391,7 @@ func Test_internalIssueAttachmentServiceImpl_Human(t *testing.T) {
name: "when the http request cannot be created",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "1110",
},
on: func(fields *fields) {
Expand Down Expand Up @@ -469,7 +469,7 @@ func Test_internalIssueAttachmentServiceImpl_Delete(t *testing.T) {
name: "when the api version is v2",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "1110",
},
on: func(fields *fields) {
Expand Down Expand Up @@ -497,7 +497,7 @@ func Test_internalIssueAttachmentServiceImpl_Delete(t *testing.T) {
name: "when the api version is v3",
fields: fields{version: "3"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "1110",
},
on: func(fields *fields) {
Expand Down Expand Up @@ -526,7 +526,7 @@ func Test_internalIssueAttachmentServiceImpl_Delete(t *testing.T) {
name: "when the attachment id is not provided",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "",
},
on: func(fields *fields) {
Expand All @@ -540,7 +540,7 @@ func Test_internalIssueAttachmentServiceImpl_Delete(t *testing.T) {
name: "when the http request cannot be created",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "1110",
},
on: func(fields *fields) {
Expand Down Expand Up @@ -628,7 +628,7 @@ func Test_internalIssueAttachmentServiceImpl_Add(t *testing.T) {
name: "when the api version is v2",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
issueKeyOrId: "DUMMY-1",
fileName: "LICENSE",
file: fileMocked,
Expand Down Expand Up @@ -658,7 +658,7 @@ func Test_internalIssueAttachmentServiceImpl_Add(t *testing.T) {
name: "when the api version is v3",
fields: fields{version: "3"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
issueKeyOrId: "DUMMY-1",
fileName: "LICENSE",
file: fileMocked,
Expand Down Expand Up @@ -688,7 +688,7 @@ func Test_internalIssueAttachmentServiceImpl_Add(t *testing.T) {
name: "when the issue key or id is not provided",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
issueKeyOrId: "",
fileName: "LICENSE",
file: fileMocked,
Expand All @@ -701,7 +701,7 @@ func Test_internalIssueAttachmentServiceImpl_Add(t *testing.T) {
name: "when the file name is not provided",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
issueKeyOrId: "DUMMY-1",
fileName: "",
file: fileMocked,
Expand All @@ -714,7 +714,7 @@ func Test_internalIssueAttachmentServiceImpl_Add(t *testing.T) {
name: "when the field reader is not provided",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
issueKeyOrId: "DUMMY-1",
fileName: "LICENSE",
file: nil,
Expand All @@ -727,7 +727,7 @@ func Test_internalIssueAttachmentServiceImpl_Add(t *testing.T) {
name: "when the http request cannot be created",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
issueKeyOrId: "DUMMY-1",
fileName: "LICENSE",
file: fileMocked,
Expand Down Expand Up @@ -808,7 +808,7 @@ func Test_internalIssueAttachmentServiceImpl_Download(t *testing.T) {
name: "when the api version is v2",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "1110",
redirect: false,
},
Expand Down Expand Up @@ -837,7 +837,7 @@ func Test_internalIssueAttachmentServiceImpl_Download(t *testing.T) {
name: "when the api version is v3",
fields: fields{version: "3"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "1110",
redirect: true,
},
Expand Down Expand Up @@ -867,7 +867,7 @@ func Test_internalIssueAttachmentServiceImpl_Download(t *testing.T) {
name: "when the attachment id is not provided",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "",
},
on: func(fields *fields) {
Expand All @@ -881,7 +881,7 @@ func Test_internalIssueAttachmentServiceImpl_Download(t *testing.T) {
name: "when the http request cannot be created",
fields: fields{version: "2"},
args: args{
ctx: context.TODO(),
ctx: context.Background(),
attachmentId: "1110",
redirect: true,
},
Expand Down
3 changes: 3 additions & 0 deletions jira/internal/issue_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type IssueServices struct {
Watcher *WatcherService
WorklogAdf *WorklogADFService
WorklogRichText *WorklogRichTextService
Property *IssuePropertyService
}

func NewIssueService(client service.Connector, version string, services *IssueServices) (*IssueRichTextService, *IssueADFService, error) {
Expand Down Expand Up @@ -64,6 +65,7 @@ func NewIssueService(client service.Connector, version string, services *IssueSe
adfService.Vote = services.Vote
adfService.Watcher = services.Watcher
adfService.Worklog = services.WorklogAdf
adfService.Property = services.Property

richTextService.Comment = services.CommentRT
richTextService.Attachment = services.Attachment
Expand All @@ -78,6 +80,7 @@ func NewIssueService(client service.Connector, version string, services *IssueSe
richTextService.Vote = services.Vote
richTextService.Watcher = services.Watcher
richTextService.Worklog = services.WorklogRichText
adfService.Property = services.Property

}

Expand Down
1 change: 1 addition & 0 deletions jira/internal/issue_impl_adf.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type IssueADFService struct {
Vote *VoteService
Watcher *WatcherService
Worklog *WorklogADFService
Property *IssuePropertyService
}

// Delete deletes an issue.
Expand Down
1 change: 1 addition & 0 deletions jira/internal/issue_impl_rich_text.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type IssueRichTextService struct {
Vote *VoteService
Watcher *WatcherService
Worklog *WorklogRichTextService
Property *IssuePropertyService
}

// Delete deletes an issue.
Expand Down
Loading

0 comments on commit 8901de1

Please sign in to comment.