Questions tagged [groovyscriptengine]
45 questions
0
votes
1 answer
Elasticsearch : No field found in mapping while executing custom score script
I've been struggling with this issue for hours now. I am trying to implement custom score in my search using script score (groovy).
Mapping :
{
"properties": {
"m_skill": {
"properties": {
"actual_period": {
…

Darth Shekhar
- 115
- 3
- 16
0
votes
1 answer
Optional parameter in Groovy Script
I have a script that simply does
// TODO: assign default value if not defined
println optionalParameter
When I invoke it using:
new GroovyShell(new Binding([optionalParameter: 'text'])).evaluate(script)
it works fine. But if I run it without a…

Michal Kordas
- 10,475
- 7
- 58
- 103
0
votes
0 answers
Use values for scripts from multiple index in elasticsearch
Is there a way to write a script that can read values from multiple indexes and produce results in Elasticsearch?
For eg:
curl -XGET 'localhost:9200/index1,index2/_search?pretty' -d '
{
"script_fields" : {
"test1" : {
"script" : {
…

karthik95
- 31
- 1
- 7
0
votes
1 answer
Loading groovy classes with conflicting names
I use GroovyScriptEngine inside my Java application to load code dynamically from different sources. Let's say I have two folders sources_A\ and sources_B\.
GroovyScriptEngine engine = new GroovyScriptEngine(new String[]{
"sources_A",…

Eric Leibenguth
- 4,167
- 3
- 24
- 51
-1
votes
0 answers
In Groovy Pipeline Script After taking a string as Parameter from the Jenkins Job How to Execute it has a Cucumber Tag inside the Pipeline Script
So I have a Groovy PipeLine Script
pipeline {
agent any
stages {
stage('Build') {
script {
build job: AWSINTparamsexp
build job: params.OPTIONS
}
}
}
}
Insight
Here…

Isaac
- 99
- 2
- 5
-1
votes
1 answer
Unable to add Long values in Groovy
Unable to add Long values in Groovy.
When we sum, it is not adding value after decimal.
Long val1 = makeNullZero(getCustomFieldValue('Benefit 1 Annual $'));
Long val2 = makeNullZero(getCustomFieldValue('Benefit 2 Annual $'));
Long val3 =…

Amit Singh
- 3
- 2
-1
votes
1 answer
Jenkins file groovy issues
Hi My jenkins file code is as follows : I am basically trying to make call to a python script and execute it, I have defined some variables in my code : And when i am trying to run it, It gives no such property error in the beginning and I cant find…

Legitimate_Figure_4430
- 85
- 2
- 9
-1
votes
1 answer
I need help in groovy script nested array
I need to loop over the below Json array and transform the data into the expected output. However, I am facing problem in looping over the nested array.
input :
[{"DomainName":"Access Supplier",
"Data_Category" :
…

mohammmed sohail
- 1
- 5
-1
votes
2 answers
How to read a text file line by line define a count function using groovy script engine in jmeter
I have a text file contains 45 lines. I need to read the text file line by line based on the counter increment function.
Example: If we read the first line of a line then it prints count value is 1 and so on...
please provide me some good examples.

chinna
- 55
- 1
- 8
-1
votes
1 answer
How to send an email using groovy script in Soap UI?
I want to send an automated email once all my test steps are passed in SOAP UI, using a groovy script test step??
Is there a way that we can achieve this ??
-1
votes
1 answer
Could anyone help me in understanding the groovy script below
I am trying to decode some groovy script. I was able to figure out that it is a regular expression but couldn't figure out what the code is exactly.
def dirNumber = this.'Directory Number'
dirNumber?"61" + (dirNumber =~ /0([0-9]+)/)[0][1] +…
-1
votes
1 answer
Groovy string parsing by ignoring "$" or any character(ps: no control over input data)
I am trying to replace a particular word say password to ******* from a string which has characters such as $ and \n in Groovy.
I cannot escape them by using \ because i have no control over data i receive and even in the final output i need as it…

Rohan
- 3
- 2
-1
votes
1 answer