Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,12 @@ func (j junit2jira) linkIssues(issues []*jira.Issue) error {
var result error
for x, issue := range issues {
for y := 0; y < x; y++ {
// Skip cases where we have the same inward and outward issue.
// Jira does not allow linking a ticket to itself.
if issue.Key == issues[y].Key {
continue
}

_, err := j.jiraClient.Issue.AddLink(&jira.IssueLink{
Type: jira.IssueLinkType{Name: linkType},
OutwardIssue: &jira.Issue{Key: issue.Key},
Expand Down