fourplusone / terraform-provider-jira

Terraform provider to configure JIRA
https://registry.terraform.io/providers/fourplusone/jira/latest
MIT License
180 stars 54 forks source link

category_id field for Jira Projects does not appear to be read during plan (server) #63

Closed adam-skalicky closed 2 years ago

adam-skalicky commented 2 years ago

Hi Folks,

When testing out Jira projects, I found that the category_id field does not appear to be read correctly.

Steps to reproduce:

Create a project with category_id defined. In the Jira console, change or remove the category within the project. Attempt a plan in Terraform against the created project. Expected result:

Terraform will propose a change to revert the category back to the value defined in the resource. Actual result:

Terraform is not aware of the change and states No changes. Your infrastructure matches the configuration.

Using Terraform v1.0.11 with Jira Server v8.20.8 with provider version 0.1.16

This appears very similar to #56

adam-skalicky commented 2 years ago

I believe this is a typing error.

Examining the Jira Go Library, I see that the ID field is a string, in the provider is is declared as an int.

https://pkg.go.dev/github.com/andygrunwald/go-jira#ProjectCategory

Changing in in my dev environment to string returned the IDs and produced a healthy diff.

adam-skalicky commented 2 years ago

Opened #64 to resolve this. One note, this will generate plan deltas for projects that may not have managed field via terraform before but do have values set in the UI.

adam-skalicky commented 2 years ago

@fourplusone would love to get any feedback and ideally see this in v0.1.17