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
e7642dd9
Commit
e7642dd9
authored
Oct 02, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add board assignee, weight, labels and milestone when creating a board issue
parent
394ca1bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
app/services/boards/issues/create_service.rb
app/services/boards/issues/create_service.rb
+8
-1
spec/services/boards/issues/create_service_spec.rb
spec/services/boards/issues/create_service_spec.rb
+18
-0
No files found.
app/services/boards/issues/create_service.rb
View file @
e7642dd9
...
...
@@ -10,11 +10,18 @@ module Boards
end
def
execute
create_issue
(
params
.
merge
(
label_ids:
[
list
.
label_id
])
)
create_issue
(
creation_params
)
end
private
def
creation_params
params
.
merge
(
label_ids:
[
list
.
label_id
,
*
board
.
label_ids
],
weight:
board
.
weight
,
milestone_id:
board
.
milestone_id
,
assignee_ids:
[
board
.
assignee_id
])
end
def
board
@board
||=
parent
.
boards
.
find
(
params
.
delete
(
:board_id
))
end
...
...
spec/services/boards/issues/create_service_spec.rb
View file @
e7642dd9
...
...
@@ -29,5 +29,23 @@ describe Boards::Issues::CreateService do
expect
(
issue
.
labels
).
to
eq
[
label
]
end
it
'adds the board assignee, weight, labels and milestone to the issue'
do
board_assignee
=
create
(
:user
)
project
.
team
<<
[
board_assignee
,
:developer
]
board_milestone
=
create
(
:milestone
,
project:
project
)
board_label
=
create
(
:label
,
project:
project
)
board
.
update!
(
assignee:
board_assignee
,
milestone:
board_milestone
,
label_ids:
[
board_label
.
id
],
weight:
4
)
issue
=
service
.
execute
expect
(
issue
.
assignees
).
to
eq
([
board_assignee
])
expect
(
issue
.
weight
).
to
eq
(
board
.
weight
)
expect
(
issue
.
milestone
).
to
eq
(
board_milestone
)
expect
(
issue
.
labels
).
to
contain_exactly
(
label
,
board_label
)
end
end
end
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