What are the situations of hash not displaying in issues

I’m using SonarQube Community Edition version 6.7.4 and try to get details about project issues using following API call.
I found some of hash is not displaying in project issues API call. (api/issues/search)
Is there any particular reason to this.

Response

{
key: "AW3u9erW8FRa7reh8576",
rule: "common-java:DuplicatedBlocks",
severity: "MAJOR",
component: "project01:model:src/main/java/com/sample/testFile1.java",
project: "project01",
flows: [ ],
status: "OPEN",
message: "2 duplicated blocks of code must be removed.",
effort: "30min",
debt: "30min",
author: "dilan2012salinda@gmail.com",
tags: 
[
	"pitfall"
],
creationDate: "2019-10-21T14:12:22+0530",
updateDate: "2019-10-21T21:05:43+0530",
type: "CODE_SMELL",
organization: "default-organization"

}

What are the situations of hash key not displaying in issues.

Hi,

It’s not clear what hash you’re talking about, when you expect to see it, when you do see it, when you don’t, and what you want to do with it.

 
Ann

Hi Ann,

This is 2 different issue object i got in issue/search API call.

1st response issue object

{
key: “AW4HfJJzauAhMqQ_yVma”,
rule: “common-java:DuplicatedBlocks”,
severity: “MAJOR”,
component: “project01:utils:src/main/java/com/dilan/FileUtils.java”,
project: “project01”,
subProject: “project01:utils”,
flows: ,
status: “OPEN”,
message: “1 duplicated blocks of code must be removed.”,
effort: “20min”,
debt: “20min”,
author: “”,
tags: ,
creationDate: “2019-09-26T15:23:16+0530”,
updateDate: “2019-09-26T15:23:16+0530”,
type: “CODE_SMELL”,
organization: “default-organization”,
}

2nd response issue object

{
key: “AW4HfJLbauAhMqQ_yVmx”,
rule: “squid:S00112”,
severity: “MAJOR”,
component: “project01:mq:src/main/java/com/dilan/MqConnectionFactory.java”,
project: “project01”,
subProject: “project01:mq”,
line: 47,
hash: “df3797b64ce4e9a510cf35d72770cd5f”,
textRange: {},
flows: ,
status: “OPEN”,
message: “Define and throw a dedicated exception instead of using a generic one.”,
effort: “20min”,
debt: “20min”,
author: “dilan2012salinda@gmail.com”,
tags: ,
creationDate: “2019-08-06T10:52:47+0530”,
updateDate: “2019-10-26T15:23:16+0530”,
type: “CODE_SMELL”,
organization: “default-organization”,
}

And also author and line attributes are not 2nd response.

Is this possible to get those all values in this API call?

The first response is showing a file level issue, so there’s no line hash associated, or author. :slight_smile: Without being associated to a specific line it can’t have a hash, or an author from SCM data.

A post was split to a new topic: Line but no hash for CSS bugs