Skip to content

Commit

Permalink
IssueService: Issue.GetCreateMeta removed, `Issue.GetCreateMetaWith…
Browse files Browse the repository at this point in the history
…Options` renamed

Related #294
  • Loading branch information
andygrunwald committed Sep 12, 2022
1 parent e22ee9a commit 5a66ee4
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 762 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,38 @@ After:
client.Issue.Update(context.Background(), issue, nil)
```

#### `Issue.GetCreateMeta` removed, `Issue.GetCreateMetaWithOptions` renamed

The function `client.Issue.GetCreateMetaWithOptions()` has been renamed to `client.Issue.GetCreateMeta()`.

##### If you used `client.Issue.GetCreateMeta()`:

Before:

```go
client.Issue.GetCreateMeta(context.Background(), "SPN")
```

After:

```go
client.Issue.GetCreateMetaWithOptions(ctx, &GetQueryOptions{ProjectKeys: "SPN", Expand: "projects.issuetypes.fields"})
```

##### If you used `client.Issue.GetCreateMetaWithOptions()`:

Before:

```go
client.Issue.GetCreateMetaWithOptions(ctx, &GetQueryOptions{ProjectKeys: "SPN", Expand: "projects.issuetypes.fields"})
```

After:

```go
client.Issue.GetCreateMeta(ctx, &GetQueryOptions{ProjectKeys: "SPN", Expand: "projects.issuetypes.fields"})
```

### Breaking changes

* Jira On-Premise and Jira Cloud have now different clients, because the API differs
Expand Down
9 changes: 2 additions & 7 deletions cloud/metaissue.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,8 @@ type MetaIssueType struct {
Fields tcontainer.MarshalMap `json:"fields,omitempty"`
}

// GetCreateMeta makes the api call to get the meta information required to create a ticket
func (s *IssueService) GetCreateMeta(ctx context.Context, projectkeys string) (*CreateMetaInfo, *Response, error) {
return s.GetCreateMetaWithOptions(ctx, &GetQueryOptions{ProjectKeys: projectkeys, Expand: "projects.issuetypes.fields"})
}

// GetCreateMetaWithOptions makes the api call to get the meta information without requiring to have a projectKey
func (s *IssueService) GetCreateMetaWithOptions(ctx context.Context, options *GetQueryOptions) (*CreateMetaInfo, *Response, error) {
// GetCreateMeta makes the api call to get the meta information without requiring to have a projectKey
func (s *IssueService) GetCreateMeta(ctx context.Context, options *GetQueryOptions) (*CreateMetaInfo, *Response, error) {
apiEndpoint := "rest/api/2/issue/createmeta"

req, err := s.client.NewRequest(ctx, http.MethodGet, apiEndpoint, nil)
Expand Down
Loading

0 comments on commit 5a66ee4

Please sign in to comment.