I'm currently modifying a SIL Data Source for a custom field KCF - Multiple Autocomplete.
In many of the examples in the documentation (here for example KCFPRO/KCF Single Autocomplete) it shows argv["query"] and makes it sound like this should return the string of the user input in the field. I enabled logging and tested this out with some print statements. argv["query"] always returns an empty string for me.
My SIL Data Source:
string[] issues = selectIssues("issuetype = Build");
string[] res;
for(string iss in issues){
if(contains(iss.summary, argv["query"])){
print("Made it inside of if: '" + argv["query"] + "'");
res = addElementIfNotExist(res, iss);
}
}
return res;
On my testing instance, I only have 5 issues of type Build. The script makes it inside of the if block all 5 times. This is because argv["query"] is the empty string. That means all of the Builds are returned from the script. However, the UI results are still restricted by the Issue Key & Summary. I was able to see this since only 1 of the Builds has an Issue Key from a project with a project key of DO. I entered DO into the field and only that 1 Build was displayed. It appears that something else is filtering down the results after the SIL Data Source.
Most importantly, I need to know how I can access the field input in my SIL Data Source.
Secondly, what else is filtering the results returned to the UI?
Example from documentation:
string [] issues = selectIssues("created < now()");
string [] res;
for (string iss in issues) {
if (contains(iss.summary, argv["query"])) {
res = addElementIfNotExist(res, iss);
}
}
return res;