hi, I am having difficulty retrieving an ‘assigne...
# help
a
hi, I am having difficulty retrieving an ‘assigned’ value (uuid) within a serveEventListener that has been set in the response, see attached mapping. Can anyone help and tell me if this is possible, or an alternative method for achieving the same result. So far I have found it possible to reuse the uuid in the response, but is null when referenced from the serveEventListeners
Copy code
{
  "request": {
    "urlPath": "/callback/test",
    "method": "POST"
  },
  "response": {
    "status": 200,
    "jsonBody": {
      "message": "Merry Xmas",
      "uuid": "{{#assign 'uuid'}}{{randomValue type='UUID'}}{{/assign}}{{uuid}}"
    }
  },
  "serveEventListeners": [
    {
      "name": "webhook",
      "parameters": {
        "method": "POST",
        "url": "<http://myhost:8716/callback/1>",
        "headers": {
          "Content-Type": "application/json"
        },
        "body": "{ \"uuid\": \"{{uuid}}\" }"
      }
    }
  ]
}
thanks
l
Hi. I don't believe this is possible at the moment. One option is to use the state extension to store the UUID and then you should be able to reference it from both places. https://github.com/wiremock/wiremock-state-extension