{
    "customfieldId": "customfield_10201",
    "name": "Remote issue picker",
    "fieldType": "STANDARD",
    "datasource": {
        "name": "Atlassian Jira",
        "category": "URL",
        "responseContentType": "JSON",
        "datasourceDefinitionId": "default:conf:2",
        "rootUrl": "https://jira.atlassian.com/rest/api/latest"
    },
    "datasourceDefinitionId": "default:conf:2",
    "editView": {
        "widgetType": "AUTOCOMPLETE",
        "fieldRequestConfiguration": {
            "query": "## TODO: adapt $issue.customfield_10200 to your configuration - it shall be the ID of the remote project picker field\n\n## Abort query if there is no project selected\n#if(!$issue.customfield_10200 || $issue.customfield_10200.length() == 0)\n  $query.abort()\n#end\n\n\n#set($jqlQuery = \"\")\n#set($userInputOrCurrencustomfieldValueSet = false)\n\n#if($userInput.length() > 0)\n  ## User has typed something in the autocomplete, we use it in the search\n  #set($jqlQuery = \"summary ~ '$userInput*' \")\n  #set($userInputOrCurrencustomfieldValueSet = true)\n#elseif($currentCustomfieldValue.length() > 0)\n  ## A value is selected, we want it in the list\n  #set($jqlQuery = $jqlQuery.concat(\"id =\"))\n  #set($jqlQuery = $jqlQuery.concat($currentCustomfieldValue.toString()))\n  #set($jqlQuery = $jqlQuery.concat(\" OR id !=\"))\n  #set($jqlQuery = $jqlQuery.concat($currentCustomfieldValue.toString()))\n  #set($jqlQuery = $jqlQuery.concat(\" \"))\n  #set($userInputOrCurrencustomfieldValueSet = true)\n#end\n\n#if($userInputOrCurrencustomfieldValueSet)\n  #set($jqlQuery = $jqlQuery.concat(\"AND \"))\n#end\n\n#set($jqlQuery = $jqlQuery.concat(\"project = \"))\n#set($jqlQuery = $jqlQuery.concat($issue.customfield_10200.toString()))\n#set($jqlQuery = $jqlQuery.concat(\" \"))\n\n\n#set($jqlQuery = $jqlQuery.concat(\"ORDER BY SUMMARY\"))\n\n## REST call to execute\nsearch?maxResults=15&fields=summary&jql=$util.encodeURIComponent($jqlQuery)",
            "keyIndex": "0",
            "dateFormat": "TIMESTAMP_S",
            "jsonRootPath": "$.issues",
            "jsonColumns": [
                {
                    "name": "id",
                    "path": "$.id"
                },
                {
                    "name": "summary",
                    "path": "$.fields.summary"
                },
                {
                    "name": "key",
                    "path": "$.key"
                }
            ]
        },
        "fieldWidgetConfiguration": {
            "isMultiple": false,
            "isDisplayUnique": false,
            "noResultLabel": "No results",
            "minCharacters": 0,
            "maxSuggestions": 15,
            "editFirstDisplay": false,
            "nbLinesDefault": 0,
            "autoSelectUnique": false,
            "autoSelectAll": false,
            "alphaSort": false,
            "templateConfiguration": {
                "displayTemplate": "<a href=\"https://jira.atlassian.com/browse/{key}\" target=\"_blank\">{key}</a> - {summary}"
            }
        }
    },
    "displayView": {
        "issueView": {
            "fieldRequestConfiguration": {
                "query": "issue/$currentCustomfieldValue",
                "keyIndex": "0",
                "dateFormat": "TIMESTAMP_S",
                "jsonRootPath": "",
                "jsonColumns": [
                    {
                        "name": "id",
                        "path": "$.id"
                    },
                    {
                        "name": "summary",
                        "path": "$.fields.summary"
                    },
                    {
                        "name": "key",
                        "path": "$.key"
                    }
                ]
            },
            "templateConfiguration": {
                "displayTemplate": "<a href=\"https://jira.atlassian.com/browse/{key}\" target=\"_blank\">{key}</a> - {summary}",
                "displayValueNotFound": "Not found {currentCustomfieldValue}"
            },
            "maxSuggestions": 15,
            "isDisplayUnique": false
        },
        "statisticsView": {
            "templateConfiguration": {
                "displayTemplate": "{key} - {summary}",
                "displayValueNotFound": "Not issue found with ID {currentCustomfieldValue}"
            }
        }
    },
    "advancedView": {
        "debuggerActive": false,
        "cacheActive": true,
        "cacheDuration": 600000,
        "bypassJqlSecurity": false
    }
}