I have a general question towards setting a value of a response.
Imagine the following response body:
{
"mobile-getjackpots-response": {
"errorcodes": [
"420"
],
"jackpots": [
{
"gametype": "1",
"jackpotamount": "1000000",
"nextDrawDay": "thursday"
}
]
}
}
I want to create a rule to set ONLY the value of "jackpotamount" to a different value and I want it to do the change irrespectively of the value it currently has or the structure of the response body. I DO NOT want to constantly adjust the response via the manual response action. This creates too much overhead when the response body is larger.
This is want I want the response to look like.
{
"mobile-getjackpots-response": {
"errorcodes": [
"420"
],
"jackpots": [
{
"gametype": "1",
"jackpotamount": "100",
"nextDrawDay": "thursday"
}
]
}
}
I tried a find and replace rule shown in the attachment, but it resulted in this:
{
"mobile-getjackpots-response": {
"errorcodes": [
"420"
],
"jackpots": [
{
"gametype": "1",
"jackpotamount": "100": "1000000",
"nextDrawDay": "thursday"
}
]
}
}
I know that I should´ve used "jackpotamount": "1000000" for this to work, but this is exactly what I try to avoid, as I dont know beforehand, what the value will be that I want to change.
I also tried it with the following regex, it should theoretically match the key-value-pair "jackpotamount": "SOME_AMOUNT"
https://regex101.com/r/u8r4IZ/1
(?:\"jackpotamount)(?:\"\s?:\s?\")(.*)(?:\")
This "cut off" the rest of the first jackpots object.
{
"mobile-getjackpots-response": {
"errorcodes": [
"420"
],
"jackpots": [
{
"gametype": "1",
"jackpotamount": "100"
}
]
}
}