How to store the WEBAPI GET response in a CSV file using powershell script

Hi All,

I want to store the WEBAPI GET response in a CSV file using powershell script but not able to see any idea on this. i got the response from the server but not able to store it in csv file. The below details are the same.

URL:https://somesonarhost/api/issues/search?componentKeys=org.sonarqube.projectone1&createdAfter=2017-10-19T13:00:00%2B0200

Responses: {
“total”: 3,
“p”: 1,
“ps”: 100,
“paging”: {
“pageIndex”: 1,
“pageSize”: 100,
“total”: 3
},
“effortTotal”: 111,
“issues”: [
{
“key”: “abcdef”,
“rule”: “709”,
“severity”: “MAJOR”,
“component”: “test”,
“project”: “abcone”,
“line”: 24,
“hash”: “454”,
“textRange”: {
“startLine”: 24,
“endLine”: 24,
“startOffset”: 8,
“endOffset”: 28
},
“flows”: ,
“status”: “OPEN”,
“message”: “welcome to this constructor.”,
“effort”: “2min”,
“debt”: “2min”,
“assignee”: “abc@hotmail.com”,
“author”: “cbz@outlook.com”,
“tags”: [
“testm”,
“guidelines”
],
“creationDate”: “2022-02-07T15:49:16+0100”,
“updateDate”: “2022-02-08T07:51:01+0100”,
“type”: “CODE_SMELL”,
“scope”: “MAIN”
},
{
“key”: “jjjjjjakj”,
“rule”: “cpp:109”,
“severity”: “MAJOR”,
“component”: “onprojet”,
“project”: “avtest”,
“line”: 199,
“hash”: “nicdeks”,
“textRange”: {
“startLine”: 199,
“endLine”: 199,
“startOffset”: 78,
“endOffset”: 82
},
“flows”: ,
“status”: “OPEN”,
“message”: “Assign this to this project”,
“effort”: “5min”,
“debt”: “5min”,
“assignee”: “cool@gmail.com”,
“author”: “best@outlook.com”,
“tags”: [
“verload”
],
“creationDate”: “2021-10-13T16:40:25+0200”,
“updateDate”: “2021-10-13T16:40:25+0200”,
“type”: “CODE_SMELL”,
“scope”: “MAIN”
},
{
“key”: “ioskpe”,
“rule”: “ab09”,
“severity”: “MAJOR”,
“component”: “welcome”,
“project”: “testproject15”,
“line”: 29,
“hash”: “colldjfldjikf”,
“textRange”: {
“startLine”: 29,
“endLine”: 29,
“startOffset”: 9,
“endOffset”: 15
},
“flows”: ,
“status”: “OPEN”,
“message”: “assing to next team”,
“effort”: “5min”,
“debt”: “5min”,
“assignee”: “uuu@hotmail.com”,
“author”: “uday@outlook.com”,
“tags”: [
“load”
],
“facets”:
}

Pease help on this…

Thank you
Manas

Hey there.

You’ll need to research converting JSON to CSV.

Thank you