{
    "customfieldId": "customfield_10804",
    "name": "Best buy - Product",
    "fieldType": "STANDARD",
    "datasource": {
        "name": "Best buy",
        "category": "URL",
        "responseContentType": "JSON",
        "datasourceDefinitionId": "default:conf:18",
        "rootUrl": "https://api.bestbuy.com/v1"
    },
    "datasourceDefinitionId": "default:conf:18",
    "editView": {
        "widgetType": "AUTOCOMPLETE",
        "fieldRequestConfiguration": {
            "query": "## 10803 is the ID of the \"Best buy Catalog\" Elements Connect field\n## Adapt to your own configuration\n#set($bestBuyCatalog = $issue.customfield_10803)\n\n## Set your best buy API key\n#set($apiKey = \"YOUR_BB_API_KEY\")\n\nproducts(\n#if($bestBuyCatalog && $bestBuyCatalog.length() > 0)\n## Add a condition on the product category only if it's set\ncategoryPath.id=\"$bestBuyCatalog\"&\n#end\nname=$util.encodeURIComponent($userInput)*)?show=name,sku&format=json&apiKey=$apiKey&pageSize=100",
            "keyIndex": "0",
            "dateFormat": "TIMESTAMP_S",
            "jsonRootPath": "$.products",
            "jsonColumns": [
                {
                    "name": "id",
                    "path": "$.sku"
                },
                {
                    "name": "name",
                    "path": "$.name"
                }
            ]
        },
        "fieldWidgetConfiguration": {
            "isMultiple": false,
            "isDisplayUnique": false,
            "noResultLabel": "No results",
            "minCharacters": 0,
            "maxSuggestions": 1500,
            "editFirstDisplay": false,
            "nbLinesDefault": 0,
            "autoSelectUnique": false,
            "autoSelectAll": false,
            "alphaSort": true,
            "templateConfiguration": {
                "displayTemplate": "{name}"
            }
        }
    },
    "displayView": {
        "issueView": {
            "fieldRequestConfiguration": {
                "query": "## Set your best buy API key\n#set($apiKey = \"YOUR_BB_API_KEY\")\nproducts/$currentCustomfieldValue$util.encodeURI(\".json\")?apiKey=$apiKey",
                "keyIndex": "0",
                "dateFormat": "TIMESTAMP_S",
                "jsonRootPath": "",
                "jsonColumns": [
                    {
                        "name": "id",
                        "path": "$.sku"
                    },
                    {
                        "name": "name",
                        "path": "$.name"
                    },
                    {
                        "name": "url",
                        "path": "$.url"
                    }
                ]
            },
            "templateConfiguration": {
                "displayTemplate": "<a href=\"{url}\" target=\"_blank\">{name}</a>",
                "displayValueNotFound": "{currentCustomfieldValue}"
            },
            "maxSuggestions": 1500,
            "isDisplayUnique": false
        },
        "statisticsView": {
            "templateConfiguration": {
                "displayTemplate": "{name}",
                "displayValueNotFound": "{currentCustomfieldValue}"
            }
        }
    },
    "advancedView": {
        "debuggerActive": false,
        "cacheActive": true,
        "cacheDuration": 86400000,
        "bypassJqlSecurity": false
    }
}
