Skip to content

Commit f7f1ef5

Browse files
committed
try to fix some issues with generateSnippets for pipeline configs to get at least some partial output from snippet generator
1 parent aecdf3f commit f7f1ef5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/main/java/org/jenkinsci/plugins/JiraTestResultReporter/JiraTestDataPublisher.java

+12-3
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ public List<AbstractFields> getConfigs() {
110110
* Getter for the default issue type
111111
* @return the default issue type
112112
*/
113-
public long getIssueType() {
114-
return JobConfigMapping.getInstance().getIssueType(getJobName());
113+
public String getIssueType() {
114+
Long issueType = JobConfigMapping.getInstance().getIssueType(getJobName());
115+
if (issueType == null) {
116+
issueType = 1L;
117+
}
118+
return Long.toString(issueType);
115119
}
116120

117121
/**
@@ -229,8 +233,13 @@ public JiraTestDataPublisher(
229233
defaultIssueType = 1L;
230234
}
231235

236+
if (configs == null){
237+
//avoid immutable list below
238+
configs = new ArrayList<AbstractFields>();
239+
}
240+
232241
this.jobConfig = new JobConfigMapping.JobConfigEntryBuilder()
233-
.withProjectKey(projectKey)
242+
.withProjectKey(Util.fixNull(projectKey))
234243
.withIssueType(defaultIssueType)
235244
.withAutoRaiseIssues(autoRaiseIssue)
236245
.withAutoResolveIssues(autoResolveIssue)

0 commit comments

Comments
 (0)