@@ -55,22 +55,29 @@ func MoveIssuesOnProjectColumn(ctx context.Context, doer *user_model.User, colum
5555 continue
5656 }
5757
58- _ , err = db . Exec (ctx , "UPDATE `project_issue` SET project_board_id=?, sorting=? WHERE issue_id=?" , column . ID , sorting , issueID )
58+ projectColumnID , err := curIssue . ProjectColumnID (ctx )
5959 if err != nil {
6060 return err
6161 }
6262
63- // add timeline to issue
64- if _ , err := issues_model .CreateComment (ctx , & issues_model.CreateCommentOptions {
65- Type : issues_model .CommentTypeProjectColumn ,
66- Doer : doer ,
67- Repo : curIssue .Repo ,
68- Issue : curIssue ,
69- ProjectID : column .ProjectID ,
70- ProjectTitle : project .Title ,
71- ProjectColumnID : column .ID ,
72- ProjectColumnTitle : column .Title ,
73- }); err != nil {
63+ if projectColumnID != column .ID {
64+ // add timeline to issue
65+ if _ , err := issues_model .CreateComment (ctx , & issues_model.CreateCommentOptions {
66+ Type : issues_model .CommentTypeProjectColumn ,
67+ Doer : doer ,
68+ Repo : curIssue .Repo ,
69+ Issue : curIssue ,
70+ ProjectID : column .ProjectID ,
71+ ProjectTitle : project .Title ,
72+ ProjectColumnID : column .ID ,
73+ ProjectColumnTitle : column .Title ,
74+ }); err != nil {
75+ return err
76+ }
77+ }
78+
79+ _ , err = db .Exec (ctx , "UPDATE `project_issue` SET project_board_id=?, sorting=? WHERE issue_id=?" , column .ID , sorting , issueID )
80+ if err != nil {
7481 return err
7582 }
7683 }
0 commit comments