fourplusone / terraform-provider-jira

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

New resource component is using soon to be deprecated leadUserName #74

Open raypettersen opened 2 years ago

raypettersen commented 2 years ago

Upon testing the new component feature, I discovered that I was unable to set accountid. The provider excepts a username but Atlassian is deprecating that input, and it's not possible to do anything else than accountid on our cloud-instance.

image

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-components/#api-rest-api-3-component-post

2022-09-11T17:12:49.388+0200 [INFO]  Starting apply for jira_component.example_component
2022-09-11T17:12:49.388+0200 [DEBUG] jira_component.example_component: applying the planned Create change
2022-09-11T17:12:49.388+0200 [TRACE] GRPCProvider: ApplyResourceChange
2022-09-11T17:12:49.658+0200 [TRACE] maybeTainted: jira_component.example_component encountered an error during creation, so it is now marked as tainted
2022-09-11T17:12:49.658+0200 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for jira_component.example_component
2022-09-11T17:12:49.658+0200 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for jira_component.example_component
2022-09-11T17:12:49.658+0200 [TRACE] evalApplyProvisioners: jira_component.example_component is tainted, so skipping provisioning
2022-09-11T17:12:49.658+0200 [TRACE] maybeTainted: jira_component.example_component was already tainted, so nothing to do
2022-09-11T17:12:49.658+0200 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for jira_component.example_component
2022-09-11T17:12:49.658+0200 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for jira_component.example_component
2022-09-11T17:12:49.658+0200 [TRACE] statemgr.Filesystem: not making a backup, because the new snapshot is identical to the old
2022-09-11T17:12:49.659+0200 [TRACE] statemgr.Filesystem: no state changes since last snapshot
2022-09-11T17:12:49.659+0200 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
2022-09-11T17:12:49.681+0200 [ERROR] vertex "jira_component.example_component" error: 'accountId' must be the only user identifying query parameter in GDPR strict mode.: request failed. Please analyze the request body for more details. Status code: 400

The provider should support leadAccountId so that it's future-proof for GDPR.

Update: Upon inspecting https://github.com/andygrunwald/go-jira/blob/main/component.go I see no signs of accountid, so I guess that might be a blocker for this project?

vinhdqhp commented 2 years ago

Hi,

I notice that module go-jira has just commited yesterday to meet the new component API of Jira Cloud, please take a look: https://github.com/andygrunwald/go-jira/blob/main/cloud/component.go

fourplusone commented 2 years ago

This looks very interesting. However, there are a few methods still missing https://github.com/andygrunwald/go-jira/blob/aeff901419eec3ebe78171a8cc535433bba52d27/cloud/component.go#L96 (e.g. update)

I hope that i'll find some time soon to come up with a proper strategy for JIRA cloud. Right now, this provider in somewhat focussed on JIRA Server / Data Center

tiberium commented 3 months ago

Any update/plans/workarounds for terraforming components in JIRA Cloud?