@@ -237,26 +237,25 @@ private boolean resolveIssues(TaskListener listener, Job project, Job job,
237
237
boolean solved = false ;
238
238
try {
239
239
for (CaseResult test : testCaseResults ) {
240
- if (test .isPassed () && test .getPreviousResult () != null && test .getPreviousResult ().isFailed ()
241
- && TestToIssueMapping .getInstance ().getTestIssueKey (job , test .getId ()) != null ) {
240
+ if (test .isPassed () && test .getPreviousResult () != null && test .getPreviousResult ().isFailed ()) {
242
241
synchronized (test .getId ()) {
243
- String issueKey = TestToIssueMapping .getInstance ().getTestIssueKey (job , test .getId ());
244
- IssueRestClient issueRestClient = getDescriptor ().getRestClient ().getIssueClient ();
245
- Issue issue = issueRestClient .getIssue (issueKey ).claim ();
246
- boolean transitionExecuted = false ;
247
- for (Transition transition : issueRestClient .getTransitions (issue ).claim ()) {
248
- if (transition .getName ().toLowerCase ().contains ("resolve" )) {
249
- issueRestClient .transition (issue , new TransitionInput (transition .getId ()));
250
- transitionExecuted = true ;
251
- solved = true ;
252
- break ;
242
+ for (String issueKey : JiraUtils .searchIssueKeys (job , envVars , test )) {
243
+ IssueRestClient issueRestClient = getDescriptor ().getRestClient ().getIssueClient ();
244
+ Issue issue = issueRestClient .getIssue (issueKey ).claim ();
245
+ boolean transitionExecuted = false ;
246
+ for (Transition transition : issueRestClient .getTransitions (issue ).claim ()) {
247
+ if (transition .getName ().toLowerCase ().contains ("resolve" )) {
248
+ issueRestClient .transition (issue , new TransitionInput (transition .getId ()));
249
+ transitionExecuted = true ;
250
+ solved = true ;
251
+ break ;
252
+ }
253
+ }
254
+
255
+ if (!transitionExecuted ) {
256
+ listener .getLogger ().println ("Could not find transition to resolve issue " + issueKey );
253
257
}
254
258
}
255
-
256
- if (!transitionExecuted ) {
257
- listener .getLogger ().println ("Could not find transition to resolve issue " + issueKey );
258
- }
259
-
260
259
}
261
260
}
262
261
}
0 commit comments