{
    "customfieldId": "customfield_10803",
    "name": "Best buy - Category",
    "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": "#set($apiKey = \"YOUR_BB_API_KEY\")\ncategories(name=$util.encodeURIComponent($userInput)*)?format=json&show=name,id,path&apiKey=$apiKey&pageSize=100",
            "keyIndex": "0",
            "dateFormat": "TIMESTAMP_S",
            "jsonRootPath": "## only categories with a level < 4\n$.categories[?(@.path.length() < 4)]",
            "jsonColumns": [
                {
                    "name": "id",
                    "path": "$.id"
                },
                {
                    "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($apiKey = \"YOUR_BB_API_KEY\")\ncategories/$currentCustomfieldValue$util.encodeURI(\".json\")?apiKey=$apiKey",
                "keyIndex": "0",
                "dateFormat": "TIMESTAMP_S",
                "jsonRootPath": "",
                "jsonColumns": [
                    {
                        "name": "id",
                        "path": "$.id"
                    },
                    {
                        "name": "name",
                        "path": "$.name"
                    },
                    {
                        "name": "url",
                        "path": "$.url"
                    }
                ]
            },
            "templateConfiguration": {
                "displayTemplate": "<a href=\"{url}\" target=\"_blank\">{name}</a>",
                "displayValueNotFound": "{currentCustomfieldValue}"
            },
            "maxSuggestions": 1500,
            "isDisplayUnique": false
        },
        "statisticsView": {
            "fieldRequestConfiguration": {
                "query": "#set($apiKey = \"YOUR_BB_API_KEY\")\ncategories/$currentCustomfieldValue$util.encodeURI(\".json\")?apiKey=$apiKey",
                "keyIndex": "0",
                "dateFormat": "TIMESTAMP_S",
                "jsonRootPath": "",
                "jsonColumns": [
                    {
                        "name": "id",
                        "path": "$.id"
                    },
                    {
                        "name": "name",
                        "path": "$.name"
                    },
                    {
                        "name": "url",
                        "path": "$.url"
                    }
                ]
            },
            "templateConfiguration": {
                "displayTemplate": "{name}",
                "displayValueNotFound": "{currentCustomfieldValue}"
            }
        }
    },
    "advancedView": {
        "debuggerActive": false,
        "cacheActive": true,
        "cacheDuration": 86400000,
        "bypassJqlSecurity": false
    }
}
