Skip to content

Commit 7ae5e1b

Browse files
committed
Do not add a comment on transition
Note, comment would only be added if the "comment" field is available on the corresponding "transition screen"
1 parent 8c281fd commit 7ae5e1b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/main/java/org/hibernate/infra/replicate/jira/service/jira/handler/JiraIssueAbstractEventHandler.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ private JiraUser toUser(String value) {
129129
}
130130

131131
private Optional<JiraTransition> prepareTransition(JiraIssue sourceIssue) {
132-
return statusToTransition(sourceIssue.fields.status.id).map(
133-
tr -> new JiraTransition(tr, "Upstream issue status updated to: " + sourceIssue.fields.status.name));
132+
return statusToTransition(sourceIssue.fields.status.id).map(JiraTransition::new);
134133
}
135134

136135
protected Optional<JiraIssueLink> prepareParentLink(String destinationKey, JiraIssue sourceIssue) {
@@ -169,12 +168,15 @@ private String prepareDescriptionQuote(JiraIssue issue) {
169168
170169
Assigned to: %s.
171170
172-
Reported by: %s.{quote}
171+
Reported by: %s.
172+
173+
Upstream status: %s.{quote}
173174
174175
175176
""".formatted(issue.key, issueUri,
176177
assignee == null ? " Unassigned" : "[%s|%s]".formatted(assignee.name(), assignee.uri()),
177-
reporter == null ? " Unknown" : "[%s|%s]".formatted(reporter.name(), reporter.uri()));
178+
reporter == null ? " Unknown" : "[%s|%s]".formatted(reporter.name(), reporter.uri()),
179+
issue.fields.status != null ? issue.fields.status.name : "Unknown");
178180
}
179181

180182
}

src/main/java/org/hibernate/infra/replicate/jira/service/jira/model/rest/JiraTransition.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ public class JiraTransition extends JiraBaseObject {
1313
public JiraTransition() {
1414
}
1515

16+
public JiraTransition(String transitionId) {
17+
this(transitionId, null);
18+
}
19+
1620
public JiraTransition(String transitionId, String comment) {
1721
transition = new JiraIssueTransition(transitionId);
1822
if (comment != null && !comment.isBlank()) {

0 commit comments

Comments
 (0)