Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jira service flags #785

Merged
merged 1 commit into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions services.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,9 @@ type JiraServiceProperties struct {
Username string `json:"username,omitempty" `
Password string `json:"password,omitempty" `
JiraIssueTransitionID string `json:"jira_issue_transition_id,omitempty"`
CommitEvents bool `json:"commit_events,omitempty" `
MergeRequestsEvents bool `json:"merge_requests_events,omitempty" `
CommentOnEventEnabled bool `json:"comment_on_event_enabled,omitempty" `
}

// UnmarshalJSON decodes the Jira Service Properties.
Expand Down Expand Up @@ -605,6 +608,9 @@ type SetJiraServiceOptions struct {
Username *string `url:"username,omitempty" json:"username,omitempty" `
Password *string `url:"password,omitempty" json:"password,omitempty" `
JiraIssueTransitionID *string `url:"jira_issue_transition_id,omitempty" json:"jira_issue_transition_id,omitempty"`
CommitEvents *bool `url:"commit_events,omitempty" json:"commit_events,omitempty"`
MergeRequestsEvents *bool `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"`
CommentOnEventEnabled *bool `url:"comment_on_event_enabled,omitempty" json:"comment_on_event_enabled,omitempty"`
}

// SetJiraService sets Jira service for a project
Expand Down
3 changes: 3 additions & 0 deletions services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ func TestSetJiraService(t *testing.T) {
Username: String("aas"),
Password: String("asd"),
JiraIssueTransitionID: String("2,3"),
CommitEvents: Bool(true),
CommentOnEventEnabled: Bool(true),
MergeRequestsEvents: Bool(true),
}

_, err := client.Services.SetJiraService(1, opt)
Expand Down