BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
790ab590
Commit
790ab590
authored
Feb 14, 2018
by
Jan Provaznik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remember assignee when moving an issue
Related to #41949
parent
557db7e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
move_service.rb
app/services/issues/move_service.rb
+2
-1
41949-move.yml
changelogs/unreleased/41949-move.yml
+5
-0
move_service_spec.rb
spec/services/issues/move_service_spec.rb
+22
-0
No files found.
app/services/issues/move_service.rb
View file @
790ab590
...
...
@@ -48,7 +48,8 @@ module Issues
new_params
=
{
id:
nil
,
iid:
nil
,
label_ids:
cloneable_label_ids
,
milestone_id:
cloneable_milestone_id
,
project:
@new_project
,
author:
@old_issue
.
author
,
description:
rewrite_content
(
@old_issue
.
description
)
}
description:
rewrite_content
(
@old_issue
.
description
),
assignee_ids:
@old_issue
.
assignee_ids
}
new_params
=
@old_issue
.
serializable_hash
.
symbolize_keys
.
merge
(
new_params
)
CreateService
.
new
(
@new_project
,
@current_user
,
new_params
).
execute
...
...
changelogs/unreleased/41949-move.yml
0 → 100644
View file @
790ab590
---
title
:
Remember assignee when moving an issue
merge_request
:
author
:
type
:
fixed
spec/services/issues/move_service_spec.rb
View file @
790ab590
...
...
@@ -232,6 +232,28 @@ describe Issues::MoveService do
end
end
context
'issue with assignee'
do
let
(
:assignee
)
{
create
(
:user
)
}
before
do
old_issue
.
assignees
=
[
assignee
]
end
it
'preserves assignee with access to the new issue'
do
new_project
.
add_reporter
(
assignee
)
new_issue
=
move_service
.
execute
(
old_issue
,
new_project
)
expect
(
new_issue
.
assignees
).
to
eq
([
assignee
])
end
it
'ignores assignee without access to the new issue'
do
new_issue
=
move_service
.
execute
(
old_issue
,
new_project
)
expect
(
new_issue
.
assignees
).
to
be_empty
end
end
context
'notes with references'
do
before
do
create
(
:merge_request
,
source_project:
old_project
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment