Repository: ctreminiom/go-atlassian
Pull request #127 (2022-06-29 06:58:28)

:fire: Added the ability to expand the issuetypesscreenschemes associ…
…ated with a screen scheme.
![image](https://user-images.githubusercontent.com/16035390/176371916-e90a507f-703d-4624-ade1-57b5bcaccf78.png)



Patch:
diff --git a/jira/v2/issueTypeScreenScheme.go b/jira/v2/issueTypeScreenScheme.go
index 3687e8d..ac5d7cf 100644
--- a/jira/v2/issueTypeScreenScheme.go
+++ b/jira/v2/issueTypeScreenScheme.go
@@ -15,7 +15,7 @@ type IssueTypeScreenSchemeService struct{ client *Client }
 // Gets returns a paginated list of issue type screen schemes.
 // Docs: https://docs.go-atlassian.io/jira-software-cloud/issues/types/screen-scheme#get-issue-type-screen-schemes
 // Atlassian Docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-type-screen-schemes/#api-rest-api-2-issuetypescreenscheme-get
-func (i *IssueTypeScreenSchemeService) Gets(ctx context.Context, options *models.IssueTypeScreenSchemeParamsScheme, startAt, maxResults int) (
+func (i *IssueTypeScreenSchemeService) Gets(ctx context.Context, options *models.ScreenSchemeParamsScheme, startAt, maxResults int) (
 	result *models.IssueTypeScreenSchemePageScheme, response *ResponseScheme, err error) {
 
 	params := url.Values{}
diff --git a/jira/v2/screenSchemes.go b/jira/v2/screenSchemes.go
index f3e6f5b..e0473e1 100644
--- a/jira/v2/screenSchemes.go
+++ b/jira/v2/screenSchemes.go
@@ -7,6 +7,7 @@ import (
 	"net/http"
 	"net/url"
 	"strconv"
+	"strings"
 )
 
 type ScreenSchemeService struct{ client *Client }
@@ -15,15 +16,30 @@ type ScreenSchemeService struct{ client *Client }
 // Only screen schemes used in classic projects are returned.
 // Docs: https://docs.go-atlassian.io/jira-software-cloud/screens/schemes#get-screen-schemes
 // Atlassian Docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screen-schemes/#api-rest-api-2-screenscheme-get
-func (s *ScreenSchemeService) Gets(ctx context.Context, screenSchemeIDs []int, startAt, maxResults int) (
+func (s *ScreenSchemeService) Gets(ctx context.Context, options *models.ScreenSchemeParamsScheme, startAt, maxResults int) (
 	result *models.ScreenSchemePageScheme, response *ResponseScheme, err error) {
 
 	params := url.Values{}
 	params.Add("startAt", strconv.Itoa(startAt))
 	params.Add("maxResults", strconv.Itoa(maxResults))
 
-	for _, schemeScheme := range screenSchemeIDs {
-		params.Add("id", strconv.Itoa(schemeScheme))
+	if options != nil {
+
+		for _, id := range options.IDs {
+			params.Add("id", strconv.Itoa(id))
+		}
+
+		if options.QueryString != "" {
+			params.Add("queryString", options.QueryString)
+		}
+
+		if options.OrderBy != "orderBy" {
+			params.Add("", options.OrderBy)
+		}
+
+		if len(options.Expand) != 0 {
+			params.Add("expand", strings.Join(options.Expand, ","))
+		}
 	}
 
 	var endpoint = fmt.Sprintf("rest/api/2/screenscheme?%v", params.Encode())
diff --git a/jira/v3/issueTypeScreenScheme.go b/jira/v3/issueTypeScreenScheme.go
index 36ac5a2..be8de71 100644
--- a/jira/v3/issueTypeScreenScheme.go
+++ b/jira/v3/issueTypeScreenScheme.go
@@ -15,7 +15,7 @@ type IssueTypeScreenSchemeService struct{ client *Client }
 // Gets returns a paginated list of issue type screen schemes.
 // Docs: https://docs.go-atlassian.io/jira-software-cloud/issues/types/screen-scheme#get-issue-type-screen-schemes
 // Atlassian Docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-type-screen-schemes/#api-rest-api-3-issuetypescreenscheme-get
-func (i *IssueTypeScreenSchemeService) Gets(ctx context.Context, options *models.IssueTypeScreenSchemeParamsScheme, startAt, maxResults int) (
+func (i *IssueTypeScreenSchemeService) Gets(ctx context.Context, options *models.ScreenSchemeParamsScheme, startAt, maxResults int) (
 	result *models.IssueTypeScreenSchemePageScheme, response *ResponseScheme, err error) {
 
 	params := url.Values{}
diff --git a/jira/v3/screenSchemes.go b/jira/v3/screenSchemes.go
index 0ccac0d..1418b92 100644
--- a/jira/v3/screenSchemes.go
+++ b/jira/v3/screenSchemes.go
@@ -7,6 +7,7 @@ import (
 	"net/http"
 	"net/url"
 	"strconv"
+	"strings"
 )
 
 type ScreenSchemeService struct{ client *Client }
@@ -15,15 +16,30 @@ type ScreenSchemeService struct{ client *Client }
 // Only screen schemes used in classic projects are returned.
 // Docs: https://docs.go-atlassian.io/jira-software-cloud/screens/schemes#get-screen-schemes
 // Atlassian Docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-schemes/#api-rest-api-3-screenscheme-get
-func (s *ScreenSchemeService) Gets(ctx context.Context, screenSchemeIDs []int, startAt, maxResults int) (
+func (s *ScreenSchemeService) Gets(ctx context.Context, options *models.ScreenSchemeParamsScheme, startAt, maxResults int) (
 	result *models.ScreenSchemePageScheme, response *ResponseScheme, err error) {
 
 	params := url.Values{}
 	params.Add("startAt", strconv.Itoa(startAt))
 	params.Add("maxResults", strconv.Itoa(maxResults))
 
-	for _, schemeScheme := range screenSchemeIDs {
-		params.Add("id", strconv.Itoa(schemeScheme))
+	if options != nil {
+
+		for _, id := range options.IDs {
+			params.Add("id", strconv.Itoa(id))
+		}
+
+		if options.QueryString != "" {
+			params.Add("queryString", options.QueryString)
+		}
+
+		if options.OrderBy != "orderBy" {
+			params.Add("", options.OrderBy)
+		}
+
+		if len(options.Expand) != 0 {
+			params.Add("expand", strings.Join(options.Expand, ","))
+		}
 	}
 
 	var endpoint = fmt.Sprintf("rest/api/3/screenscheme?%v", params.Encode())
diff --git a/pkg/infra/models/jira_issue_type_screen_scheme.go b/pkg/infra/models/jira_issue_type_screen_scheme.go
index aee4976..be87642 100644
--- a/pkg/infra/models/jira_issue_type_screen_scheme.go
+++ b/pkg/infra/models/jira_issue_type_screen_scheme.go
@@ -1,6 +1,6 @@
 package models
 
-type IssueTypeScreenSchemeParamsScheme struct {
+type ScreenSchemeParamsScheme struct {
 	IDs         []int
 	QueryString string
 	OrderBy     string


Test patch:
diff --git a/jira/v2/issueTypeScreenScheme_test.go b/jira/v2/issueTypeScreenScheme_test.go
index 286bfe9..7a07543 100644
--- a/jira/v2/issueTypeScreenScheme_test.go
+++ b/jira/v2/issueTypeScreenScheme_test.go
@@ -773,7 +773,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 
 	testCases := []struct {
 		name               string
-		options            *models.IssueTypeScreenSchemeParamsScheme
+		options            *models.ScreenSchemeParamsScheme
 		startAt            int
 		maxResults         int
 		mockFile           string
@@ -785,7 +785,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 	}{
 		{
 			name: "GetIssueTypeSchemesWhenTheParametersAreCorrect",
-			options: &models.IssueTypeScreenSchemeParamsScheme{
+			options: &models.ScreenSchemeParamsScheme{
 				IDs:         []int{1000, 1001, 1002},
 				QueryString: "DUMMY",
 				OrderBy:     "id",
@@ -803,7 +803,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 
 		{
 			name: "GetIssueTypeSchemesWhenTheEndpointIsIncorrect",
-			options: &models.IssueTypeScreenSchemeParamsScheme{
+			options: &models.ScreenSchemeParamsScheme{
 				IDs:         []int{1000, 1001, 1002},
 				QueryString: "DUMMY",
 				OrderBy:     "id",
@@ -821,7 +821,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 
 		{
 			name: "GetIssueTypeSchemesWhenTheRequestMethodIsIncorrect",
-			options: &models.IssueTypeScreenSchemeParamsScheme{
+			options: &models.ScreenSchemeParamsScheme{
 				IDs:         []int{1000, 1001, 1002},
 				QueryString: "DUMMY",
 				OrderBy:     "id",
@@ -839,7 +839,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 
 		{
 			name: "GetIssueTypeSchemesWhenTheStatusCodeIsIncorrect",
-			options: &models.IssueTypeScreenSchemeParamsScheme{
+			options: &models.ScreenSchemeParamsScheme{
 				IDs:         []int{1000, 1001, 1002},
 				QueryString: "DUMMY",
 				OrderBy:     "id",
@@ -857,7 +857,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 
 		{
 			name: "GetIssueTypeSchemesWhenTheContextIsNil",
-			options: &models.IssueTypeScreenSchemeParamsScheme{
+			options: &models.ScreenSchemeParamsScheme{
 				IDs:         []int{1000, 1001, 1002},
 				QueryString: "DUMMY",
 				OrderBy:     "id",
@@ -875,7 +875,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 
 		{
 			name: "GetIssueTypeSchemesWhenTheResponseBodyHasADifferentFormat",
-			options: &models.IssueTypeScreenSchemeParamsScheme{
+			options: &models.ScreenSchemeParamsScheme{
 				IDs:         []int{1000, 1001, 1002},
 				QueryString: "DUMMY",
 				OrderBy:     "id",
diff --git a/jira/v2/screenSchemes_test.go b/jira/v2/screenSchemes_test.go
index 6e91168..fb82d9b 100644
--- a/jira/v2/screenSchemes_test.go
+++ b/jira/v2/screenSchemes_test.go
@@ -331,7 +331,7 @@ func TestScreenSchemeService_Gets(t *testing.T) {
 
 	testCases := []struct {
 		name                string
-		screenSchemeIDs     []int
+		options             *models.ScreenSchemeParamsScheme
 		startAt, maxResults int
 		mockFile            string
 		wantHTTPMethod      string
@@ -341,78 +341,108 @@ func TestScreenSchemeService_Gets(t *testing.T) {
 		wantErr             bool
 	}{
 		{
-			name:               "GetScreenSchemesWhenTheParamsAreCorrect",
-			screenSchemeIDs:    []int{1000, 1001, 1002, 1002},
+			name: "GetScreenSchemesWhenTheParamsAreCorrect",
+			options: &models.ScreenSchemeParamsScheme{
+				IDs:         []int{1000, 1001, 1002, 1002},
+				QueryString: "query-string",
+				OrderBy:     "name",
+				Expand:      []string{"issueTypeScreenSchemes"},
+			},
 			startAt:            0,
 			maxResults:         50,
 			mockFile:           "../v3/mocks/get-screen-schemes.json",
 			wantHTTPMethod:     http.MethodGet,
-			endpoint:           "/rest/api/2/screenscheme?id=1000&id=1001&id=1002&id=1002&maxResults=50&startAt=0",
+			endpoint:           "/rest/api/2/screenscheme?=name&expand=issueTypeScreenSchemes&id=1000&id=1001&id=1002&id=1002&maxResults=50&queryString=query-string&startAt=0",
 			context:            context.Background(),
 			wantHTTPCodeReturn: http.StatusOK,
 			wantErr:            false,
 		},
 
 		{
-			name:               "GetScreenSchemesWhenTheScreenSchemeIDsIsNil",
-			screenSchemeIDs:    nil,
+			name: "GetScreenSchemesWhenTheScreenSchemeIDsIsNil",
+			options: &models.ScreenSchemeParamsScheme{
+				IDs:         []int{1000, 1001, 1002, 1002},
+				QueryString: "query-string",
+				OrderBy:     "name",
+				Expand:      []string{"issueTypeScreenSchemes"},
+			},
 			startAt:            0,
 			maxResults:         50,
 			mockFile:           "../v3/mocks/get-screen-schemes.json",
 			wantHTTPMethod:     http.MethodGet,
-			endpoint:           "/rest/api/2/screenscheme?maxResults=50&startAt=0",
+			endpoint:           "/rest/api/2/screenscheme?=name&expand=issueTypeScreenSchemes&id=1000&id=1001&id=1002&id=1002&maxResults=50&queryString=query-string&startAt=0",
 			context:            context.Background(),
 			wantHTTPCodeReturn: http.StatusOK,
 			wantErr:            false,
 		},
 
 		{
-			name:               "GetScreenSchemesWhenTheContextIsNil",
-			screenSchemeIDs:    []int{1000, 1001, 1002, 1002},
+			name: "GetScreenSchemesWhenTheContextIsNil",
+			options: &models.ScreenSchemeParamsScheme{
+				IDs:         []int{1000, 1001, 1002, 1002},
+				QueryString: "query-string",
+				OrderBy:     "name",
+				Expand:      []string{"issueTypeScreenSchemes"},
+			},
 			startAt:            0,
 			maxResults:         50,
 			mockFile:           "../v3/mocks/get-screen-schemes.json",
 			wantHTTPMethod:     http.MethodGet,
-			endpoint:           "/rest/api/2/screenscheme?id=1000&id=1001&id=1002&id=1002&maxResults=50&startAt=0",
+			endpoint:           "/rest/api/2/screenscheme?=name&expand=issueTypeScreenSchemes&id=1000&id=1001&id=1002&id=1002&maxResults=50&queryString=query-string&startAt=0",
 			context:            nil,
 			wantHTTPCodeReturn: http.StatusOK,
 			wantErr:            true,
 		},
 
 		{
-			name:               "GetScreenSchemesWhenTheRequestMethodIsIncorrect",
-			screenSchemeIDs:    []int{1000, 1001, 1002, 1002},
+			name: "GetScreenSchemesWhenTheRequestMethodIsIncorrect",
+			options: &models.ScreenSchemeParamsScheme{
+				IDs:         []int{1000, 1001, 1002, 1002},
+				QueryString: "query-string",
+				OrderBy:     "name",
+				Expand:      []string{"issueTypeScreenSchemes"},
+			},
 			startAt:            0,
 			maxResults:         50,
 			mockFile:           "../v3/mocks/get-screen-schemes.json",
 			wantHTTPMethod:     http.MethodPost,
-			endpoint:           "/rest/api/2/screenscheme?id=1000&id=1001&id=1002&id=1002&maxResults=50&startAt=0",
+			endpoint:           "/rest/api/2/screenscheme?=name&expand=issueTypeScreenSchemes&id=1000&id=1001&id=1002&id=1002&maxResults=50&queryString=query-string&startAt=0",
 			context:            context.Background(),
 			wantHTTPCodeReturn: http.StatusOK,
 			wantErr:            true,
 		},
 
 		{
-			name:               "GetScreenSchemesWhenTheStatusCodeIsIncorrect",
-			screenSchemeIDs:    []int{1000, 1001, 1002, 1002},
+			name: "GetScreenSchemesWhenTheStatusCodeIsIncorrect",
+			options: &models.ScreenSchemeParamsScheme{
+				IDs:         []int{1000, 1001, 1002, 1002},
+				QueryString: "query-string",
+				OrderBy:     "name",
+				Expand:      []string{"issueTypeScreenSchemes"},
+			},
 			startAt:            0,
 			maxResults:         50,
 			mockFile:           "../v3/mocks/get-screen-schemes.json",
 			wantHTTPMethod:     http.MethodGet,
-			endpoint:           "/rest/api/2/screenscheme?id=1000&id=1001&id=1002&id=1002&maxResults=50&startAt=0",
+			endpoint:           "/rest/api/2/screenscheme?=name&expand=issueTypeScreenSchemes&id=1000&id=1001&id=1002&id=1002&maxResults=50&queryString=query-string&startAt=0",
 			context:            context.Background(),
 			wantHTTPCodeReturn: http.StatusBadRequest,
 			wantErr:            true,
 		},
 
 		{
-			name:               "GetScreenSchemesWhenTheResponseBodyHasADifferentFormat",
-			screenSchemeIDs:    []int{1000, 1001, 1002, 1002},
+			name: "GetScreenSchemesWhenTheResponseBodyHasADifferentFormat",
+			options: &models.ScreenSchemeParamsScheme{
+				IDs:         []int{1000, 1001, 1002, 1002},
+				QueryString: "query-string",
+				OrderBy:     "name",
+				Expand:      []string{"issueTypeScreenSchemes"},
+			},
 			startAt:            0,
 			maxResults:         50,
 			mockFile:           "../v3/mocks/empty_json.json",
 			wantHTTPMethod:     http.MethodGet,
-			endpoint:           "/rest/api/2/screenscheme?id=1000&id=1001&id=1002&id=1002&maxResults=50&startAt=0",
+			endpoint:           "/rest/api/2/screenscheme?=name&expand=issueTypeScreenSchemes&id=1000&id=1001&id=1002&id=1002&maxResults=50&queryString=query-string&startAt=0",
 			context:            context.Background(),
 			wantHTTPCodeReturn: http.StatusOK,
 			wantErr:            true,
@@ -446,7 +476,7 @@ func TestScreenSchemeService_Gets(t *testing.T) {
 
 			i := &ScreenSchemeService{client: mockClient}
 
-			gotResult, gotResponse, err := i.Gets(testCase.context, testCase.screenSchemeIDs, testCase.startAt,
+			gotResult, gotResponse, err := i.Gets(testCase.context, testCase.options, testCase.startAt,
 				testCase.maxResults)
 
 			if testCase.wantErr {
diff --git a/jira/v3/issueTypeScreenScheme_test.go b/jira/v3/issueTypeScreenScheme_test.go
index 8cad0b6..e277eb1 100644
--- a/jira/v3/issueTypeScreenScheme_test.go
+++ b/jira/v3/issueTypeScreenScheme_test.go
@@ -773,7 +773,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 
 	testCases := []struct {
 		name               string
-		options            *models.IssueTypeScreenSchemeParamsScheme
+		options            *models.ScreenSchemeParamsScheme
 		startAt            int
 		maxResults         int
 		mockFile           string
@@ -785,7 +785,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 	}{
 		{
 			name: "GetIssueTypeSchemesWhenTheParametersAreCorrect",
-			options: &models.IssueTypeScreenSchemeParamsScheme{
+			options: &models.ScreenSchemeParamsScheme{
 				IDs:         []int{1000, 1001, 1002},
 				QueryString: "DUMMY",
 				OrderBy:     "id",
@@ -803,7 +803,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 
 		{
 			name: "GetIssueTypeSchemesWhenTheEndpointIsIncorrect",
-			options: &models.IssueTypeScreenSchemeParamsScheme{
+			options: &models.ScreenSchemeParamsScheme{
 				IDs:         []int{1000, 1001, 1002},
 				QueryString: "DUMMY",
 				OrderBy:     "id",
@@ -821,7 +821,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 
 		{
 			name: "GetIssueTypeSchemesWhenTheRequestMethodIsIncorrect",
-			options: &models.IssueTypeScreenSchemeParamsScheme{
+			options: &models.ScreenSchemeParamsScheme{
 				IDs:         []int{1000, 1001, 1002},
 				QueryString: "DUMMY",
 				OrderBy:     "id",
@@ -839,7 +839,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 
 		{
 			name: "GetIssueTypeSchemesWhenTheStatusCodeIsIncorrect",
-			options: &models.IssueTypeScreenSchemeParamsScheme{
+			options: &models.ScreenSchemeParamsScheme{
 				IDs:         []int{1000, 1001, 1002},
 				QueryString: "DUMMY",
 				OrderBy:     "id",
@@ -857,7 +857,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 
 		{
 			name: "GetIssueTypeSchemesWhenTheContextIsNil",
-			options: &models.IssueTypeScreenSchemeParamsScheme{
+			options: &models.ScreenSchemeParamsScheme{
 				IDs:         []int{1000, 1001, 1002},
 				QueryString: "DUMMY",
 				OrderBy:     "id",
@@ -875,7 +875,7 @@ func TestIssueTypeScreenSchemeService_Gets(t *testing.T) {
 
 		{
 			name: "GetIssueTypeSchemesWhenTheResponseBodyHasADifferentFormat",
-			options: &models.IssueTypeScreenSchemeParamsScheme{
+			options: &models.ScreenSchemeParamsScheme{
 				IDs:         []int{1000, 1001, 1002},
 				QueryString: "DUMMY",
 				OrderBy:     "id",
diff --git a/jira/v3/screenSchemes_test.go b/jira/v3/screenSchemes_test.go
index 3a34fdb..086e9d3 100644
--- a/jira/v3/screenSchemes_test.go
+++ b/jira/v3/screenSchemes_test.go
@@ -350,7 +350,7 @@ func TestScreenSchemeService_Gets(t *testing.T) {
 
 	testCases := []struct {
 		name                string
-		screenSchemeIDs     []int
+		options             *models.ScreenSchemeParamsScheme
 		startAt, maxResults int
 		mockFile            string
 		wantHTTPMethod      string
@@ -360,78 +360,108 @@ func TestScreenSchemeService_Gets(t *testing.T) {
 		wantErr             bool
 	}{
 		{
-			name:               "GetScreenSchemesWhenTheParamsAreCorrect",
-			screenSchemeIDs:    []int{1000, 1001, 1002, 1003},
+			name: "GetScreenSchemesWhenTheParamsAreCorrect",
+			options: &models.ScreenSchemeParamsScheme{
+				IDs:         []int{1000, 1001, 1002, 1002},
+				QueryString: "query-string",
+				OrderBy:     "name",
+				Expand:      []string{"issueTypeScreenSchemes"},
+			},
 			startAt:            0,
 			maxResults:         50,
-			mockFile:           "./mocks/get-screen-schemes.json",
+			mockFile:           "../v3/mocks/get-screen-schemes.json",
 			wantHTTPMethod:     http.MethodGet,
-			endpoint:           "/rest/api/3/screenscheme?id=1000&id=1001&id=1002&id=1003&maxResults=50&startAt=0",
+			endpoint:           "/rest/api/3/screenscheme?=name&expand=issueTypeScreenSchemes&id=1000&id=1001&id=1002&id=1002&maxResults=50&queryString=query-string&startAt=0",
 			context:            context.Background(),
 			wantHTTPCodeReturn: http.StatusOK,
 			wantErr:            false,
 		},
 
 		{
-			name:               "GetScreenSchemesWhenTheScreenSchemeIDsIsNil",
-			screenSchemeIDs:    nil,
+			name: "GetScreenSchemesWhenTheScreenSchemeIDsIsNil",
+			options: &models.ScreenSchemeParamsScheme{
+				IDs:         []int{1000, 1001, 1002, 1002},
+				QueryString: "query-string",
+				OrderBy:     "name",
+				Expand:      []string{"issueTypeScreenSchemes"},
+			},
 			startAt:            0,
 			maxResults:         50,
-			mockFile:           "./mocks/get-screen-schemes.json",
+			mockFile:           "../v3/mocks/get-screen-schemes.json",
 			wantHTTPMethod:     http.MethodGet,
-			endpoint:           "/rest/api/3/screenscheme?maxResults=50&startAt=0",
+			endpoint:           "/rest/api/3/screenscheme?=name&expand=issueTypeScreenSchemes&id=1000&id=1001&id=1002&id=1002&maxResults=50&queryString=query-string&startAt=0",
 			context:            context.Background(),
 			wantHTTPCodeReturn: http.StatusOK,
 			wantErr:            false,
 		},
 
 		{
-			name:               "GetScreenSchemesWhenTheContextIsNil",
-			screenSchemeIDs:    []int{1000, 1001, 1002, 1003},
+			name: "GetScreenSchemesWhenTheContextIsNil",
+			options: &models.ScreenSchemeParamsScheme{
+				IDs:         []int{1000, 1001, 1002, 1002},
+				QueryString: "query-string",
+				OrderBy:     "name",
+				Expand:      []string{"issueTypeScreenSchemes"},
+			},
 			startAt:            0,
 			maxResults:         50,
-			mockFile:           "./mocks/get-screen-schemes.json",
+			mockFile:           "../v3/mocks/get-screen-schemes.json",
 			wantHTTPMethod:     http.MethodGet,
-			endpoint:           "/rest/api/3/screenscheme?id=1000&id=1001&id=1002&id=1003&maxResults=50&startAt=0",
+			endpoint:           "/rest/api/3/screenscheme?=name&expand=issueTypeScreenSchemes&id=1000&id=1001&id=1002&id=1002&maxResults=50&queryString=query-string&startAt=0",
 			context:            nil,
 			wantHTTPCodeReturn: http.StatusOK,
 			wantErr:            true,
 		},
 
 		{
-			name:               "GetScreenSchemesWhenTheRequestMethodIsIncorrect",
-			screenSchemeIDs:    []int{1000, 1001, 1002, 1003},
+			name: "GetScreenSchemesWhenTheRequestMethodIsIncorrect",
+			options: &models.ScreenSchemeParamsScheme{
+				IDs:         []int{1000, 1001, 1002, 1002},
+				QueryString: "query-string",
+				OrderBy:     "name",
+				Expand:      []string{"issueTypeScreenSchemes"},
+			},
 			startAt:            0,
 			maxResults:         50,
-			mockFile:           "./mocks/get-screen-schemes.json",
+			mockFile:           "../v3/mocks/get-screen-schemes.json",
 			wantHTTPMethod:     http.MethodPost,
-			endpoint:           "/rest/api/3/screenscheme?id=1000&id=1001&id=1002&id=1003&maxResults=50&startAt=0",
+			endpoint:           "/rest/api/3/screenscheme?=name&expand=issueTypeScreenSchemes&id=1000&id=1001&id=1002&id=1002&maxResults=50&queryString=query-string&startAt=0",
 			context:            context.Background(),
 			wantHTTPCodeReturn: http.StatusOK,
 			wantErr:            true,
 		},
 
 		{
-			name:               "GetScreenSchemesWhenTheStatusCodeIsIncorrect",
-			screenSchemeIDs:    []int{1000, 1001, 1002, 1003},
+			name: "GetScreenSchemesWhenTheStatusCodeIsIncorrect",
+			options: &models.ScreenSchemeParamsScheme{
+				IDs:         []int{1000, 1001, 1002, 1002},
+				QueryString: "query-string",
+				OrderBy:     "name",
+				Expand:      []string{"issueTypeScreenSchemes"},
+			},
 			startAt:            0,
 			maxResults:         50,
-			mockFile:           "./mocks/get-screen-schemes.json",
+			mockFile:           "../v3/mocks/get-screen-schemes.json",
 			wantHTTPMethod:     http.MethodGet,
-			endpoint:           "/rest/api/3/screenscheme?id=1000&id=1001&id=1002&id=1003&maxResults=50&startAt=0",
+			endpoint:           "/rest/api/3/screenscheme?=name&expand=issueTypeScreenSchemes&id=1000&id=1001&id=1002&id=1002&maxResults=50&queryString=query-string&startAt=0",
 			context:            context.Background(),
 			wantHTTPCodeReturn: http.StatusBadRequest,
 			wantErr:            true,
 		},
 
 		{
-			name:               "GetScreenSchemesWhenTheResponseBodyHasADifferentFormat",
-			screenSchemeIDs:    []int{1000, 1001, 1002, 1003},
+			name: "GetScreenSchemesWhenTheResponseBodyHasADifferentFormat",
+			options: &models.ScreenSchemeParamsScheme{
+				IDs:         []int{1000, 1001, 1002, 1002},
+				QueryString: "query-string",
+				OrderBy:     "name",
+				Expand:      []string{"issueTypeScreenSchemes"},
+			},
 			startAt:            0,
 			maxResults:         50,
-			mockFile:           "./mocks/empty_json.json",
+			mockFile:           "../v3/mocks/empty_json.json",
 			wantHTTPMethod:     http.MethodGet,
-			endpoint:           "/rest/api/3/screenscheme?id=1000&id=1001&id=1002&id=1003&maxResults=50&startAt=0",
+			endpoint:           "/rest/api/3/screenscheme?=name&expand=issueTypeScreenSchemes&id=1000&id=1001&id=1002&id=1002&maxResults=50&queryString=query-string&startAt=0",
 			context:            context.Background(),
 			wantHTTPCodeReturn: http.StatusOK,
 			wantErr:            true,
@@ -465,7 +495,7 @@ func TestScreenSchemeService_Gets(t *testing.T) {
 
 			i := &ScreenSchemeService{client: mockClient}
 
-			gotResult, gotResponse, err := i.Gets(testCase.context, testCase.screenSchemeIDs, testCase.startAt,
+			gotResult, gotResponse, err := i.Gets(testCase.context, testCase.options, testCase.startAt,
 				testCase.maxResults)
 
 			if testCase.wantErr {