MyPureCloud / terraform-provider-genesyscloud

Terraform Provider Genesyscloud
MIT License
37 stars 85 forks source link

Fault assigning an extension to a group using resource genesyscloud_group #524

Closed vernonvandam closed 1 year ago

vernonvandam commented 1 year ago

I've done an export of a resource to verify my data. Export is:

resource "genesyscloud_group" "PPE_Test_Group" {
  addresses {
    extension = "9000"
    number    = "9000"
    type      = "GROUPRING"
  }
  owner_ids     = ["1d94106d-c3ce-4018-aea8-fbf0a8fd0a97", "d66b4261-89cb-4831-9b2a-9a9447c72706"]
  type          = "official"
  visibility    = "members"
  name          = "PPE_Test_Group"
  rules_visible = true
}

I try create a group and assign an extension number as in the above example and get an error:

resource "genesyscloud_group" "PPE_Test_Group2" {
  type          = "official"
  visibility    = "public"
  name          = "PPE Test Group2"
  owner_ids     = [data.genesyscloud_user.user.id]
  member_ids    = [data.genesyscloud_user.user.id]
  rules_visible = true
  addresses {
    extension = "9001"
    number    = "9001"
    type      = "GROUPRING"
  }
}

Error is:
│ Error: Failed to parse number in an E164 format. Passed 9001 and expected: +19001 │ │ with module.groups.genesyscloud_group.PPE_Test_Group2, │ on modules\genesyscloud_group\main.tf line 87, in resource "genesyscloud_group" "PPE_Test_Group2": │ 87: resource "genesyscloud_group" "PPE_Test_Group2" {

I created the resource like this now and don't get the above error:

resource "genesyscloud_group" "PPE_Test_Group2" {
  type          = "official"
  visibility    = "public"
  name          = "PPE Test Group2"
  owner_ids     = [data.genesyscloud_user.user.id]
  member_ids    = [data.genesyscloud_user.user.id]
  rules_visible = true
  addresses {
    extension = "+619001"
    number    = "+619001"
    type      = "GROUPRING"
  }
}

When looking at the Genesys Cloud UI,

for the group created manually (9000): the number is displayed in the lower corner displays as Group Phone ext. 9000

for the group created through Terrafrom (9001): the number is displayed in the lower corner displays as Group Phone +619001 ext. +619001 the Enabled Calls in top right is set to "off" if I set that to "on" both Group Phone Number and Extension is filled in but it should only have an extension.

FAULTS:

  1. The resource addresses nested schema only accepts E164 formats
  2. No option to only assign and extension value
  3. In Genesys Cloud UI, Enabled Calls for the group is off
  4. Both number and extension fields are assigned to the group
  5. In the Extensions Assignments, 9001 has not been assigned to the group
carnellj-genesys commented 1 year ago

Tracking with DEVENGAGE-1937

saravanakumar-rogers commented 1 year ago

Hello Team - We too facing the same issue in the documentation it is mentioned addresses { number = "3174181234" type = "GROUPRING" } number = (String) Phone number for this contact type.

when we try to upgrade the provider client version it is excepting E.164 format and failing the upgrade. Let us in which version this will get fixed.

carnellj-genesys commented 1 year ago

Hello Team - We too facing the same issue in the documentation it is mentioned addresses { number = "3174181234" type = "GROUPRING" } number = (String) Phone number for this contact type.

when we try to upgrade the provider client version it is excepting E.164 format and failing the upgrade. Let us in which version this will get fixed.

Hi Saravanakumar,

You must be using an pretty old provider as we have been enforcing the E.164 phone number for quite a while.

  1. We had to start enforcing E.164 number format on the front end (CX as Code provider) because the backend APIs would store phone numbers often very loosely and in many cases mutate whatever the user provided into an E.164 number. Terraform is very strict about what you are sending to the downstream API should match whats in the state file.
  2. Thank you for pointing out the inconsistencies in the documentation. I have made sure everywhere we validate a phone number is using the E.164 constraint check that the documentation was updated. The documentation has been updated and available in the next release. (1-2 weeks out) Thanks, John