我正在尝试从问题列表中获取组件行(代码行),我正在使用 /api/issues/search?ps=500&p=1&statuses=OPEN
但是,问题数组有一些没有“线”属性的对象。
在此示例中,第二个对象具有“线”属性,但第一个对象没有:
{
"key": "353163de-a4df-40e3-82f0-9a39e94bd1db",
"rule": "squid:S00105",
"severity": "MINOR",
"component": "revision_tqc_r5:controlador/cl/ps/io/Word.java",
"componentId": 374,
"project": "revision_tqc_r5",
"flows": [],
"status": "OPEN",
"message": "Replace all tab characters in this file by sequences of white-spaces.",
"effort": "2min",
"debt": "2min",
"author": "",
"tags": [(...)],
"creationDate": "2016-04-20T22:14:21+0200",
"updateDate": "2016-04-20T22:14:21+0200",
"type": "CODE_SMELL"
},
{
"key": "3535f5e2-622d-42d3-b18c-a555c4b7c182",
"rule": "css:leading-zeros",
"severity": "MINOR",
"component": "revision_tqc_r5:vista/web/defectos/wpscripts/wpstyleslogin.css",
"componentId": 3037,
"project": "revision_tqc_r5",
"line": 100,
"textRange": {(...)},
"flows": [],
"status": "OPEN",
"message": "Remove this leading zero",
"effort": "2min",
"debt": "2min",
"author": "",
"tags": [(...)],
"creationDate": "2016-04-20T22:14:21+0200",
"updateDate": "2016-04-20T22:14:21+0200",
"type": "CODE_SMELL"
}
如何在问题数组的这些对象中显示“行”属性?
谢谢。