Skip to content

Commit

Permalink
Merge pull request #12 from dheeruk12/main
Browse files Browse the repository at this point in the history
bug fix in integrations
  • Loading branch information
vishwa306 authored Jul 29, 2022
2 parents 3c76fe7 + 28b0d2f commit 407a601
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/resources/zenduty_integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Integrations can be imported using the `team_id`(ie. unique_id of the team) and

`$ terraform state show zenduty_integrations.integration1`

`* copy the output data and paste inside zenduty_integrations.integration1 resource block and remove the id attribute`
`* copy the output data and paste inside zenduty_integrations.integration1 resource block and remove the id,integration_key,webhook_url attributes`

`$ terraform plan` to verify the import

Expand Down
10 changes: 6 additions & 4 deletions zenduty/resource_integrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ func resourceIntegrations() *schema.Resource {
},
"integration_key": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"webhook_url": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"is_enabled": {
Type: schema.TypeBool,
Expand Down Expand Up @@ -146,11 +146,13 @@ func resourceIntegrationUpdate(Ctx context.Context, d *schema.ResourceData, m in
newIntegration.Default_Urgency = v.(int)
}

_, err := apiclient.Integrations.UpdateIntegration(team_id, service_id, id, newIntegration)
integration, err := apiclient.Integrations.UpdateIntegration(team_id, service_id, id, newIntegration)
if err != nil {
return diag.FromErr(err)
}

d.Set("integration_key", integration.Integration_key)
d.Set("is_enabled", integration.Is_Enabled)
d.Set("webhook_url", integration.Webhook_url)
// added integration_key in response output

return diags
Expand Down

0 comments on commit 407a601

Please sign in to comment.