Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update integration fails with error - "You can not assign integration to another team" #35

Open
milonjames opened this issue Mar 27, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@milonjames
Copy link

milonjames commented Mar 27, 2020

Hi,
I am getting the following error while trying to update an integration.

{"code":40301,"message":"You can not assign integration to another team","took":0.002,"requestId":"2986a890-3fd3-4f5e-973b-4e6034c5936a"}

I think this could be due to a bug in the function 'ForceUpdateAllFields'

https://github.com/opsgenie/opsgenie-go-sdk-v2/blob/v1.1/integration/integration.go#L57

There we can see that it's not passing the 'OwnerTeam' argument to the request. And in my trial runs using curl, I found that if I try to update an integration without passing the 'ownerTeam' argument in the JSON payload, it will result in the same error.

curl -X PUT 'https://api.eu.opsgenie.com/v2/integrations/<integration_id>' --header 'Authorization: GenieKey<API_KEY>' --header 'Content-Type: application/json' --data '{ "enabled": true, "ignoreRespondersFromPayload": true, "name": "<INTEGRATION_NAME>", "suppressNotifications": true, "responders": [], "type": "API" }'

{"code":40301,"message":"You can not assign integration to another team","took":0.002,"requestId":"2986a890-3fd3-4f5e-973b-4e6034c5936a"}

Please note I am using an API key from an API integration which I have created under my 'team' to authenticate the SDK to OpsGenie. Could that be an issue?

@cemkucuk
Copy link

hey @milonjames
Does this problem still exist? Can you confirm?

@cemkucuk cemkucuk added the bug Something isn't working label May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants