But i only need the 23 as environment variable.
My test script looks like this what do i have to do to only get the 23?
pm.environment.set(‘DownloadLink’, pm.response.json().message);
You could take a look at the .split() JS method to get that part of the string. This will create a new array of values based on the separator provided. Then you would need to specify the item you want, this will be zero-indexed so 0 would be the first item.
For example:
let messageString = pm.response.json().message
pm.environment.set("DownloadLink", messageString.split('/')[5])
This obviously fails to extract that value is the position were to change.
“There was an error in evaluating the test script: TypeError: Cannot read property ‘split’ of undefined”.
I need to capture only the “[email protected]” value as a variable from the “description” string below. Is the error occurring because “description” is nested in the ticket property? Can you suggest adjustments to script to capture the value as a variable?