Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
23e81bfd
Commit
23e81bfd
authored
8 years ago
by
Adam Niedzielski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore external issues when bulk assigning issues to author of merge request.
Fixes #23552
parent
2510345e
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
app/services/merge_requests/assign_issues_service.rb
app/services/merge_requests/assign_issues_service.rb
+1
-1
spec/services/merge_requests/assign_issues_service_spec.rb
spec/services/merge_requests/assign_issues_service_spec.rb
+12
-0
No files found.
app/services/merge_requests/assign_issues_service.rb
View file @
23e81bfd
...
...
@@ -4,7 +4,7 @@ module MergeRequests
@assignable_issues
||=
begin
if
current_user
==
merge_request
.
author
closes_issues
.
select
do
|
issue
|
!
issue
.
assignee_id?
&&
can?
(
current_user
,
:admin_issue
,
issue
)
!
issue
.
is_a?
(
ExternalIssue
)
&&
!
issue
.
assignee_id?
&&
can?
(
current_user
,
:admin_issue
,
issue
)
end
else
[]
...
...
This diff is collapsed.
Click to expand it.
spec/services/merge_requests/assign_issues_service_spec.rb
View file @
23e81bfd
...
...
@@ -46,4 +46,16 @@ describe MergeRequests::AssignIssuesService, services: true do
it
'assigns these to the merge request owner'
do
expect
{
service
.
execute
}.
to
change
{
issue
.
reload
.
assignee
}.
to
(
user
)
end
it
'ignores external issues'
do
external_issue
=
ExternalIssue
.
new
(
'JIRA-123'
,
project
)
service
=
described_class
.
new
(
project
,
user
,
merge_request:
merge_request
,
closes_issues:
[
external_issue
]
)
expect
(
service
.
assignable_issues
.
count
).
to
eq
0
end
end
This diff is collapsed.
Click to expand it.
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