'How to grab data from the body and from the response of the call and use this data in the next call for the bulk run

I have got an interesting task and am not sure how to proceed with this

I have 1 POST request to create the Release for each Project. The request body has the "ProjectID" on it and in the Response body I have got the "ReleaseID" POST | URL: ........./release

The 2nd POST request is to add the "Cycle" to the created release by using the individual "ReleaseIDs" we received in the response body of the previous call and also we need to use the "ProjectID" from the previous request body POST | URL: ............/cycle

Task: How to automate the following process: Grab the ProjectId from the request body of the 1st call and the ReleaseId from the response body of the 1st call and push this data to the request body of the 2nd call P. S. We would do that by Running the cvs file with over 100 records

Here are the requests to make it more clear:

1st call Body: ____WE NEED to grab "ProjectID" from here

"release": {

"name": "TEST API Releas35",

"description": "",

"startDate": "",

"targetDate": "",

"projectID": "5149"

}

Response: _____WE NEED to grab "releaseID" from here

{

"success": true,

"code": "AD.RELEASE_SUCCESSFUL",

"message": "Release added successfully.",

"data": [

{

"ENTITY_KEY": "{RELEASE$}(TEST API Releas35)",

"releaseID": 39168,

"releaseName": "TEST API Releas35",

"builds": [

{

"name": "LKGB",

"isArchive": false,

"buildID": 70785

}

]

}

]

}

2nd call_to add the cycle to this release:

{

"cycle": {

"name": "{{cycle2}}",

"startDate": "",

"targetDate": "",

"projectID": "{{QMprojectID}}",

"releaseID": "{{versionID}}"

}

}

P.s. We would do that by running the CVC file that has over 50 "ProjectIDs"

Actually, we would send the following requests:

1st:

{

"release": {

"name": "{{version}}",

"description": "{{description}}",

"startDate": "{{Qmstartdate}}",

"targetDate": "{{Qmtargetdate}}",

"projectID": "{{QMprojectID}}"

}

2nd:

{

"cycle": {

"name": "{{cycle2}}",

"startDate": "",

"targetDate": "",

"projectID": "{{QMprojectID}}",

"releaseID": "{{releaseID}}"

}

}

Example of the excel file we use: enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source