Unable to remove default_queue_id from worktype using terraform

I have created a worktype using terraform with a default queue id using the following code:

setup

resource "genesyscloud_task_management_workitem_schema" "tag-attributes" {
  name = "tag-attributes"
  properties = jsonencode(
    {
      access_codes_tag = {
        allOf = [
          {
            "$ref" = "#/definitions/tag"
          },
        ]
        description = ""
        items = {
          maxLength = 10
          minLength = 1
        }
        maxItems    = 10
        minItems    = 0
        title       = "access_codes"
        uniqueItems = true
      }
    }
  )
}

resource genesyscloud_routing_queue "TerraformQueue"{
  name = "TerraformQueue"
}

resource genesyscloud_task_management_workbin "TerraformWorkbin" {
  name = "TerraformWorkbin"
}

resource genesyscloud_task_management_worktype "TerraformWorkType" {
  default_status_name = "Open"
  default_workbin_id  = genesyscloud_task_management_workbin.TerraformWorkbin.id
  default_queue_id    = genesyscloud_routing_queue.TerraformQueue.id
  description         = "Test worktype for Terraform"
  name                = "TerraformWorkType"
  schema_id = genesyscloud_task_management_workitem_schema.tag-attributes.id
  statuses {
    category = "Closed"
    name     = "Closed"
  }
  statuses {
    category = "Open"
    name     = "Open"
  }
}

If i then try to remove the default_queue_id from the workbin, i get the following error when trying to apply the change:

planned change:

  # genesyscloud_task_management_worktype.TerraformWorkType will be updated in-place
  ~ resource "genesyscloud_task_management_worktype" "TerraformWorkType" {
      - default_queue_id             = "f354bbd4-c921-4f93-837d-1193dceea5b8" -> null
        id                           = "edfcf83f-675b-498d-957b-c10350a7cff0"
        name                         = "TerraformWorkType"
        # (14 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

resulting error:

genesyscloud_task_management_worktype.TerraformWorkType: Modifying... [id=edfcf83f-675b-498d-957b-c10350a7cff0]
╷
│ Error: failed to update task management worktype: failed to update task management worktype edfcf83f-675b-498d-957b-c10350a7cff0: API Error: 400 - No change for the record is obtained. (0efe3f90-bf77-4d49-80f4-650cacb82c10) {"hasBody":true,"rawBody":"eyJtZXNzYWdlIjoiTm8gY2hhbmdlIGZvciB0aGUgcmVjb3JkIGlzIG9idGFpbmVkLiIsImNvZGUiOiJpbnZhbGlkLmlucHV0Lm5vLmNoYW5nZSIsInN0YXR1cyI6NDAwLCJtZXNzYWdlUGFyYW1zIjp7fSwiY29udGV4dElkIjoiMGVmZTNmOTAtYmY3Ny00ZDQ5LTgwZjQtNjUwY2FjYjgyYzEwIiwiZGV0YWlscyI6W10sImVycm9ycyI6W119","statusCode":400,"status":"400 Bad Request","error":{"status":400,"message":"No change for the record is obtained.","code":"invalid.input.no.change","contextId":"0efe3f90-bf77-4d49-80f4-650cacb82c10"},"errorMessage":"API Error: 400 - No change for the record is obtained. (0efe3f90-bf77-4d49-80f4-650cacb82c10)","correlationId":"0efe3f90-bf77-4d49-80f4-650cacb82c10","header":{"Cache-Control":["no-cache, no-store, must-revalidate"],"Content-Length":["192"],"Content-Type":["application/json"],"Date":["Sun, 02 Jun 2024 10:24:00 GMT"],"Inin-Correlation-Id":["0efe3f90-bf77-4d49-80f4-650cacb82c10"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains"],"Via":["1.1 809aab597f9b26cadc42a1c11dd373d8.cloudfront.net (CloudFront)"],"X-Amz-Cf-Id":["1E-1XwANT4S2zxbQosqeMuKAocQ--V5eJ0pjQ0FByltHshC_4PRsCg=="],"X-Amz-Cf-Pop":["AMS58-P2"],"X-Cache":["Error from cloudfront"]}}
│ 
│   with genesyscloud_task_management_worktype.TerraformWorkType,
│   on worktypes.tf line 213, in resource "genesyscloud_task_management_worktype" "TerraformWorkType":
│  213: resource genesyscloud_task_management_worktype "TerraformWorkType" {
│ 
╵

It is possible to o the change through the UI, allowing me to continue, but would expect the terraform to work on this relatively simple change.

Anything I can do to fix this?

Hi Rene,

Thanks for bringing this to our attention. I have asked my team to review their current workload and see if someone has the bandwidth to work on this in this Sprint. If they don't, our Sprint begins next Tuesday so we would schedule it and then begin looking at it.

Thanks,
John

Hi @rvgate

This is addressed and it is now in Release v1.40.0 · MyPureCloud/terraform-provider-genesyscloud · GitHub

Please let us know if it resolves the problem for you.

Thanks
Hemanth.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.