Hi Guys.
I have a problem can you help me please?
I have a field that returns the result of a service (End Point). However, it does not return all 37,065 results and does not work out complete in field conversion. what did I do wrong?
Conversion:
getFieldByName("Orgão").convertToMultiSelect([
ajaxOptions: [
url : getBaseUrl() + "/rest/scriptrunner/latest/custom",
query: true,
minQueryLength: 2,
keyInputPeriod: 500,
formatResponse: "general",
]
])
Result: In the image below I can only get the result up to (C) and there is no link to show the rest and the autocomplete does not work.
Thanks.
Hi @Fernando Passos can you share source code or you REST API endpoint /rest/scriptrunner/latest/custom?
Hi @Martin Bayer _MoroSystems_ s_r_o__ , yes of course follow.
Thanks.
import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.json.JsonBuilder
import groovy.transform.BaseScript
import groovyx.net.http.ContentType
import groovyx.net.http.HTTPBuilder
import groovyx.net.http.Method
import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response
import org.apache.log4j.Logger
import org.apache.log4j.Level
def log = Logger.getLogger("com.localhost.getlistaRestricaoQuery")
log.setLevel(Level.DEBUG)
@BaseScript CustomEndpointDelegate delegate
getlistaRestricaoQuery(httpMethod: "GET") { MultivaluedMap queryParams ->;
def rt = [:]
def httpBuilder = new HTTPBuilder(“URL”)
def repos = httpBuilder.request(Method.GET, ContentType.JSON) {
uri.path = “URL”
headers."User-Agent" = "My JIRA"
response.failure = { reader;
log.warn("Failed to query getlistaRestricao: " + reader.text)
}
}
//def repoNames = repos["value"]*."name"
def repoNames = repos["items"]*."value"
//def repoNames = repos*."value"
log.debug "data from getlistaRestricaoQuery:"+repoNames
rt = [
items: repoNames.collect { String repo ->
[
value: repo,
html: repo,
label: repo,
]
},
total: repoNames.size(),
footer: "Escolha o Orgão... (apresentando 1 de ${repoNames.size()} ...)"
]
return Response.ok(new JsonBuilder(rt).toString()).build();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I think the URL in your behaviours should be set to
And you need to get query parameter value
... then you can use query when calling your httpBuilder request if your endpoing "URL" accepts query to filter results, otherwise you need to filter results (repoNames) using query property.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I hid my original url is this one.
def rt = [:]
def httpBuilder = new HTTPBuilder("https://servicos-int.lista.com.br")
def repos = httpBuilder.request(Method.GET, ContentType.JSON) {
uri.path = "/Backoffice/inst/PLD/rest/getlista/43"
headers."User-Agent" = "My JIRA"
Reading the service works perfectly, the problem is in the visualization it is only showing the first five thousand items on the list. The other items on the list are hidden.
for example:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, so you load all the values on the beginning, right? And you expect filtering of values already loaded in the field.
I think you should ask Adaptavist because I didn't find anything in the documentation what describes max size of collection in the dropdown.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.