I'm trying to get a list of some issues on a jira board. I'm trying to extend the tutorial project on the spring website. So far I can get the id and key from a single issue since they are normal objects. But I'm failing on getting a list of all current issues.
{
expand: "schema,names"
startAt: 0
maxResults: 50
total: 250
issues: [
{
expand: "operations,versionedRepr…hangelog,renderedFields"
id: "36384"
key: "PE-1327"
fields: {…}
},
{
expand: "operations,versionedRepr…hangelog,renderedFields"
id: "32853"
key: "PE-775"
fields: {…}
},
{
expand: "operations,versionedRepr…hangelog,renderedFields"
id: "32855"
key: "PE-777"
fields: {…}
}
]
}
Snippet of my main class:
@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.basicAuthentication(auth,auth2).build();
}
@Bean
public CommandLineRunner run(RestTemplate restTemplate) throws Exception {
return args -> {
ValueList response = restTemplate.getForObject(
"https://jiraURL/rest/agile/1.0/board/67/issue",
ValueList.class);
List<Value> valueData = response.getValueList();
log.info(valueData.toString());
};
}
My Value Pojo for the data inside "issues"
@JsonIgnoreProperties(ignoreUnknown = true)
public class Value {
private Long id;
private String key;
public Value() {
}
public Long getId() {
return this.id;
}
public String getKey() {
return this.key;
}
public void setId(Long id) {
this.id = id;
}
public void setKey(String quote) {
this.key = quote;
}
@Override
public String toString() {
return "issues{" +
"id=" + id +
", key='" + key + ''' +
'}';
}
}
My ValueList class
public class ValueList {
private List<Value> valueList;
//getter and setter
The output I get is just
[]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…