Object assigned to wrong division through data source

Hello,

We have an issue where an object gets assigned to wrong division based on a data source result.

Please see Genesys Case 0003435625 which we believe could be the cause of this issue.

Data source definition:
data "genesyscloud_auth_division" "division-name" {
name = "DivisionName"
}

Assignment:
division_id = data.genesyscloud_auth_division.division-name.id

Divisions in our environment (/api/v2/authorization/divisions API):
{
"entities": [
{
...
"name": "Another DivisionName",
...
},
{
...
"name": "DivisionName",
...
}
],
...
}

The issue is that the assignment above assigns the object to "Another DivisionName", where we expect it to be assigned to "DivisionName".

Thank you.

Hi JMakacek,

Thanks for bringing this up. I looked at the code and think the API call is doing a partial name match and not an exact name match hence why we are getting more than 1 result back in CX as Code. In the data source, we are returning the first item returned.

I will ping our support team and make sure they do not close the care case and get this escalated to my team. I need to check with my team and see if this sprint can pick up this ticket. If there is not we can get it into our next Sprint and then have a deployment out in two weeks.

As a workaround (you could rename the division to introduce some text that would prevent it from being picked up by the API. The problem is that that the API is picking up on the DivisionName in both records.

Thanks,
John Carnell
Director, Developer Engagement

Hi JMakecek,

We put a check in the code to go through the results and return the division that matches the exact name. It should be deployed on Monday or Tuesday of next week with the next CX as Code release. I also talked with the support team and they are tracking this ticket. Thanks for reporting this.

Thanks,
John Carnell
Director, Developer Engagement

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