diff --git a/bitbucket/data_project_hooks.go b/bitbucket/data_project_hooks.go index cb0ce31..bf370a4 100644 --- a/bitbucket/data_project_hooks.go +++ b/bitbucket/data_project_hooks.go @@ -6,6 +6,7 @@ import ( "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" "net/url" + "sort" ) type PaginatedProjectHooksValue struct { @@ -169,6 +170,7 @@ func readProjectHooks(m interface{}, project string, typeFilter string) ([]Proje } for _, hook := range projectHooks.Values { + sort.Strings(hook.Details.ScopeTypes) h := ProjectHook{ Key: hook.Details.Key, Name: hook.Details.Name, diff --git a/bitbucket/data_repository_hooks.go b/bitbucket/data_repository_hooks.go index cfd8c72..2c83a96 100644 --- a/bitbucket/data_repository_hooks.go +++ b/bitbucket/data_repository_hooks.go @@ -6,6 +6,7 @@ import ( "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" "net/url" + "sort" ) type PaginatedRepositoryHooksValue struct { @@ -174,6 +175,7 @@ func readRepositoryHooks(m interface{}, project string, repository string, typeF } for _, hook := range repositoryHooks.Values { + sort.Strings(hook.Details.ScopeTypes) h := RepositoryHook{ Key: hook.Details.Key, Name: hook.Details.Name,