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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
7532c012
Commit
7532c012
authored
Aug 08, 2016
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user is now notified when creating an issue through the api
parent
0357df0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
CHANGELOG
CHANGELOG
+1
-0
lib/api/issues.rb
lib/api/issues.rb
+16
-2
No files found.
CHANGELOG
View file @
7532c012
...
...
@@ -70,6 +70,7 @@ v 8.11.0
- Remove the http_parser.rb dependency by removing the tinder gem. !5758 (tbalthazar)
- Add Koding (online IDE) integration
- Ability to specify branches for Pivotal Tracker integration (Egor Lynko)
- Creating an issue through our API now emails label subscribers !5720
- Fix don't pass a local variable called `i` to a partial. !20510 (herminiotorres)
- Fix rename `add_users_into_project` and `projects_ids`. !20512 (herminiotorres)
- Fix adding line comments on the initial commit to a repo !5900
...
...
lib/api/issues.rb
View file @
7532c012
...
...
@@ -154,6 +154,20 @@ module API
render_api_error!
({
labels:
errors
},
400
)
end
if
params
[
:labels
].
present?
params
[
:labels
]
=
params
[
:labels
].
split
(
","
).
each
{
|
word
|
word
.
strip!
}
attrs
[
:label_ids
]
=
[]
params
[
:labels
].
each
do
|
label
|
existing_label
=
user_project
.
labels
.
where
(
title:
label
).
first
unless
existing_label
.
nil?
attrs
[
:label_ids
]
<<
existing_label
.
id
params
[
:labels
].
delete
(
label
)
end
end
end
project
=
user_project
issue
=
::
Issues
::
CreateService
.
new
(
project
,
current_user
,
attrs
.
merge
(
request:
request
,
api:
true
)).
execute
...
...
@@ -163,10 +177,10 @@ module API
end
if
issue
.
valid?
#
Find or create
labels and attach to issue. Labels are valid because
#
create new
labels and attach to issue. Labels are valid because
# we already checked its name, so there can't be an error here
if
params
[
:labels
].
present?
issue
.
add_labels_by_names
(
params
[
:labels
]
.
split
(
','
)
)
issue
.
add_labels_by_names
(
params
[
:labels
])
end
present
issue
,
with:
Entities
::
Issue
,
current_user:
current_user
...
...
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