private function findWebHook(Integration $integration, array $jsonResult)
    {
        $type = $integration->type;
        $hookUrl = $integration->getLink('#hook');
        if ($integration->type === 'bitbucket') {
            $hooks = $jsonResult['values'];
        } else {
            $hooks = $jsonResult;
        }
        foreach ($hooks as $hook) {
            if ($type === 'github' && $hook['config']['url'] === $hookUrl) {
                return $hook;
            }
            if ($type === 'gitlab' && $hook['url'] === $hookUrl) {
                return $hook;
            }
            if ($type === 'bitbucket' && $hook['url'] === $hookUrl) {
                return $hook;
            }
        }

        return false;
    }