{
    "customfieldId": "customfield_10811",
    "name": "Best buy - Product details",
    "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": "READONLY",
        "fieldRequestConfiguration": {
            "query": "## Set your own Best Buy API\n#set($apiKey = \"YOUR_BB_API_KEY\")\n\n## 10804 is the id of the Best Buy product field - adapt to your own configuration\n#set($bestBuyProduct = $issue.customfield_10804)\n\n#if(!$bestBuyProduct || $bestBuyProduct.length() == 0)\n  $query.abort()\n#end\nproducts/$bestBuyProduct$util.encodeURI(\".json\")?apiKey=$apiKey",
            "keyIndex": "0",
            "dateFormat": "TIMESTAMP_S",
            "jsonRootPath": "",
            "jsonColumns": [
                {
                    "name": "id",
                    "path": "$.sku"
                },
                {
                    "name": "customerReviewAverage",
                    "path": "$.customerReviewAverage"
                },
                {
                    "name": "availability",
                    "path": "$.onlineAvailabilityText"
                },
                {
                    "name": "desc",
                    "path": "$.shortDescription"
                },
                {
                    "name": "manufacturer",
                    "path": "$.manufacturer"
                },
                {
                    "name": "image",
                    "path": "$.mediumImage"
                },
                {
                    "name": "warranty",
                    "path": "$.warrantyLabor"
                },
                {
                    "name": "price",
                    "path": "$.regularPrice"
                }
            ]
        },
        "fieldWidgetConfiguration": {
            "isMultiple": false,
            "isDisplayUnique": false,
            "noResultLabel": "Select a product first",
            "maxSuggestions": 1500,
            "editFirstDisplay": false,
            "nbLinesDefault": 0,
            "autoSelectUnique": false,
            "autoSelectAll": false,
            "alphaSort": true,
            "templateConfiguration": {
                "displayTemplateMode": "CUSTOM",
                "displayTemplate": "<style>\n  .best-buy-product-price {\n    font-size: 18px;\n    margin-top: 20px;\n    margin-left: 5px;\n  }\n  .best-buy-product-desc {\n    color: #333;\n    margin: 10px;\n    margin-top: 0px;\n    border-left: 1px solid #333;\n    padding-left: 10px;\n  }\n  table.best-buy-product-main-table {\n    border: none;\n    margin-top: 20px;\n  }  \n  table.best-buy-product-main-table td {\n    vertical-align: top;\n  }\n  .best-buy-product-image {\n    max-width: 100px;\n    max-height: 110px;\n    margin-left: 10px;\n    margin-right: 20px;\n  }\n</style>\n<table class=\"best-buy-product-main-table\">\n  <tr>\n    <td>\n      <img src=\"{image}\" class=\"best-buy-product-image\"/>\n    </td>\n    <td>\n      <div class=\"best-buy-product-desc\">{desc}</div>\n    </td>\n    </td>\n  </tr>\n</table>\n\n\n<table class=\"aui\">\n  <tbody>\n    <tr>\n      <td><strong>Manufacturer</strong></td>\n      <td>{manufacturer}</td>\n    </tr>\n    <tr>\n      <td><strong>Rating</strong></td>\n      <td>{customerReviewAverage} / 5</td>\n    </tr>\n    <tr>\n      <td><strong>Availability</strong></td>\n      <td>{availability}</td>\n    </tr>\n    <tr>\n      <td><strong>Warranty</strong></td>\n      <td>{warranty}</td>\n    </tr>\n  </tbody>\n</table>\n\n<div class=\"best-buy-product-price\">${price}</div>"
            }
        }
    },
    "displayView": {
        "issueView": {
            "fieldRequestConfiguration": {
                "query": "## Set your own Best Buy API\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": "customerReviewAverage",
                        "path": "$.customerReviewAverage"
                    },
                    {
                        "name": "availability",
                        "path": "$.onlineAvailabilityText"
                    },
                    {
                        "name": "desc",
                        "path": "$.shortDescription"
                    },
                    {
                        "name": "manufacturer",
                        "path": "$.manufacturer"
                    },
                    {
                        "name": "image",
                        "path": "$.mediumImage"
                    },
                    {
                        "name": "warranty",
                        "path": "$.warrantyLabor"
                    },
                    {
                        "name": "price",
                        "path": "$.regularPrice"
                    }
                ]
            },
            "isDisplayUnique": false
        }
    },
    "advancedView": {
        "debuggerActive": false,
        "cacheActive": true,
        "cacheDuration": 86400000,
        "bypassJqlSecurity": false
    }
}
