Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cherry-pick #7761 fix(jira): set issue_assignees' assignee_name correctly #7762

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
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
60 changes: 30 additions & 30 deletions backend/plugins/jira/e2e/snapshot_tables/issue_assignees.csv
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
issue_id,assignee_id,assignee_name
jira:JiraIssue:2:10063,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,
jira:JiraIssue:2:10064,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,
jira:JiraIssue:2:10065,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,
jira:JiraIssue:2:10066,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,
jira:JiraIssue:2:10067,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,
jira:JiraIssue:2:10068,jira:JiraAccount:2:5ecfbd0c2490cf0c09e2e598,
jira:JiraIssue:2:10070,jira:JiraAccount:2:5ecfbd0ba04d9c0c220c18d8,
jira:JiraIssue:2:10071,jira:JiraAccount:2:5ecfbd0ba04d9c0c220c18d8,
jira:JiraIssue:2:10072,jira:JiraAccount:2:5ecfbd0ba04d9c0c220c18d8,
jira:JiraIssue:2:10076,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,
jira:JiraIssue:2:10077,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,
jira:JiraIssue:2:10078,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,
jira:JiraIssue:2:10079,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,
jira:JiraIssue:2:10081,jira:JiraAccount:2:5ecfbd0aaa47a00c1997ea8e,
jira:JiraIssue:2:10082,jira:JiraAccount:2:5ecfbd0984083c0c12e5af8f,
jira:JiraIssue:2:10085,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,
jira:JiraIssue:2:10086,jira:JiraAccount:2:5ecfbd0aaa47a00c1997ea8e,
jira:JiraIssue:2:10087,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,
jira:JiraIssue:2:10088,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,
jira:JiraIssue:2:10089,jira:JiraAccount:2:5ecfbd0ba04d9c0c220c18d8,
jira:JiraIssue:2:10090,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,
jira:JiraIssue:2:10091,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,
jira:JiraIssue:2:10092,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,
jira:JiraIssue:2:10093,jira:JiraAccount:2:5ecfbd0ba04d9c0c220c18d8,
jira:JiraIssue:2:10094,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,
jira:JiraIssue:2:10095,jira:JiraAccount:2:5ecfbd0984083c0c12e5af8f,
jira:JiraIssue:2:10096,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,
jira:JiraIssue:2:10097,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,
jira:JiraIssue:2:10098,jira:JiraAccount:2:5ecfbd0ba04d9c0c220c18d8,
jira:JiraIssue:2:10099,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,
jira:JiraIssue:2:10063,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,Dingding Zhang
jira:JiraIssue:2:10064,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,Dingding Zhang
jira:JiraIssue:2:10065,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,Dingding Zhang
jira:JiraIssue:2:10066,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,Dingding Zhang
jira:JiraIssue:2:10067,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,Dingding Zhang
jira:JiraIssue:2:10068,jira:JiraAccount:2:5ecfbd0c2490cf0c09e2e598,Gerile Tu
jira:JiraIssue:2:10070,jira:JiraAccount:2:5ecfbd0ba04d9c0c220c18d8,yanghui
jira:JiraIssue:2:10071,jira:JiraAccount:2:5ecfbd0ba04d9c0c220c18d8,yanghui
jira:JiraIssue:2:10072,jira:JiraAccount:2:5ecfbd0ba04d9c0c220c18d8,yanghui
jira:JiraIssue:2:10076,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,yuxiang
jira:JiraIssue:2:10077,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,yuxiang
jira:JiraIssue:2:10078,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,yuxiang
jira:JiraIssue:2:10079,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,yuxiang
jira:JiraIssue:2:10081,jira:JiraAccount:2:5ecfbd0aaa47a00c1997ea8e,chao.cheng
jira:JiraIssue:2:10082,jira:JiraAccount:2:5ecfbd0984083c0c12e5af8f,lin.hao
jira:JiraIssue:2:10085,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,yuxiang
jira:JiraIssue:2:10086,jira:JiraAccount:2:5ecfbd0aaa47a00c1997ea8e,chao.cheng
jira:JiraIssue:2:10087,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,Dingding Zhang
jira:JiraIssue:2:10088,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,yuxiang
jira:JiraIssue:2:10089,jira:JiraAccount:2:5ecfbd0ba04d9c0c220c18d8,yanghui
jira:JiraIssue:2:10090,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,Dingding Zhang
jira:JiraIssue:2:10091,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,Dingding Zhang
jira:JiraIssue:2:10092,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,yuxiang
jira:JiraIssue:2:10093,jira:JiraAccount:2:5ecfbd0ba04d9c0c220c18d8,yanghui
jira:JiraIssue:2:10094,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,Dingding Zhang
jira:JiraIssue:2:10095,jira:JiraAccount:2:5ecfbd0984083c0c12e5af8f,lin.hao
jira:JiraIssue:2:10096,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,Dingding Zhang
jira:JiraIssue:2:10097,jira:JiraAccount:2:5ecfbd0a47d31e0c2a15fd87,yuxiang
jira:JiraIssue:2:10098,jira:JiraAccount:2:5ecfbd0ba04d9c0c220c18d8,yanghui
jira:JiraIssue:2:10099,jira:JiraAccount:2:5ecfbd0c730ec90c1999cadf,Dingding Zhang
20 changes: 10 additions & 10 deletions backend/plugins/jira/tasks/issue_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func ConvertIssues(subtaskCtx plugin.SubTaskContext) errors.Error {
return db.Cursor(clauses...)
},
Convert: func(jiraIssue *models.JiraIssue) ([]interface{}, errors.Error) {
var result []interface{}
issue := &ticket.Issue{
DomainEntity: domainlayer.DomainEntity{
Id: issueIdGen.Generate(jiraIssue.ConnectionId, jiraIssue.IssueId),
Expand Down Expand Up @@ -116,16 +117,6 @@ func ConvertIssues(subtaskCtx plugin.SubTaskContext) errors.Error {
if jiraIssue.CreatorDisplayName != "" {
issue.CreatorName = jiraIssue.CreatorDisplayName
}
var result []interface{}
if jiraIssue.AssigneeAccountId != "" {
issue.AssigneeId = accountIdGen.Generate(data.Options.ConnectionId, jiraIssue.AssigneeAccountId)
issueAssignee := &ticket.IssueAssignee{
IssueId: issue.Id,
AssigneeId: issue.AssigneeId,
AssigneeName: issue.AssigneeName,
}
result = append(result, issueAssignee)
}
if jiraIssue.AssigneeDisplayName != "" {
issue.AssigneeName = jiraIssue.AssigneeDisplayName
}
Expand All @@ -136,6 +127,15 @@ func ConvertIssues(subtaskCtx plugin.SubTaskContext) errors.Error {
issue.Type = ticket.SUBTASK
}
result = append(result, issue)
if jiraIssue.AssigneeAccountId != "" {
issue.AssigneeId = accountIdGen.Generate(data.Options.ConnectionId, jiraIssue.AssigneeAccountId)
issueAssignee := &ticket.IssueAssignee{
IssueId: issue.Id,
AssigneeId: issue.AssigneeId,
AssigneeName: issue.AssigneeName,
}
result = append(result, issueAssignee)
}
boardIssue := &ticket.BoardIssue{
BoardId: boardId,
IssueId: issue.Id,
Expand Down
Loading