Unanswered question

Json Extractor or regular expression Extraction for response having back slashes.

Hi,

Attached is my response and i have difficulty extracting the variables
Json.extracting jobdescriptionid based on jobstatus
$[?(@.JobDescriptionStatus=='Draft')].JobDescriptionId)
Regular expression
(?=.*?JobDescriptionStatus\\":\\"Draft)JobDescriptionId\\":([a-zA-Z0-9]+
this is extracting all the id's and not checking for status.
I need help to figure out exact expression.

Jaya R.
Jaya R.

Jaya R.

Level
0
6 / 100
points

Answers

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

There's maybe a way without using JSONPath and probably not efficient but it seems to work.

JobDescriptionId\\":(\d+),[^^]{10,180}"JobDescriptionStatus\\":\\"Draft\\"

The search limit 0,180 is totally arbitrary but that should extract your 4 ID's when the status is Draft.