Skip to content

Commit

Permalink
check for cloud oauth instance for comment webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mickmister committed Jun 2, 2023
1 parent 2f03e43 commit dc58dd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions server/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ func (ic InstanceCommon) GetID() types.ID {
func (ic *InstanceCommon) Common() *InstanceCommon {
return ic
}

func (ic InstanceCommon) IsCloudInstance() bool {
return ic.Type == CloudInstanceType || ic.Type == CloudOAuthInstanceType
}
2 changes: 1 addition & 1 deletion server/webhook_jira.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (jwh *JiraWebhook) expandIssue(p *Plugin, instanceID types.ID) error {

// Jira Cloud comment event. We need to fetch issue data because it is not expanded in webhook payload.
isCommentEvent := jwh.WebhookEvent == commentCreated || jwh.WebhookEvent == commentUpdated || jwh.WebhookEvent == commentDeleted
if isCommentEvent && instance.Common().Type == "cloud" {
if isCommentEvent && instance.Common().IsCloudInstance() {
issue, err := p.getIssueDataForCloudWebhook(instance, jwh.Issue.ID)
if err != nil {
return err
Expand Down

0 comments on commit dc58dd5

Please sign in to comment.