diff options
author | Matt Tyson <mtyson@redhat.com> | 2016-01-15 15:44:09 +0100 |
---|---|---|
committer | Gervase Markham <gerv@mozilla.org> | 2016-01-15 15:44:09 +0100 |
commit | 38e12dd8a2c0b35391f20b60e9e3e8643c08f404 (patch) | |
tree | 17bc36ed5ff0a19741fc88378fbddc2578936b2b /Bugzilla/Bug.pm | |
parent | 513b4458b42e7f20ee0e57995c339c2dd6c495e7 (diff) | |
download | bugzilla-38e12dd8a2c0b35391f20b60e9e3e8643c08f404.tar.gz bugzilla-38e12dd8a2c0b35391f20b60e9e3e8643c08f404.tar.xz |
'Bug 1159057: change to create flags as part of bug creation process. r=gerv
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r-- | Bugzilla/Bug.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index bd3bf587c..4f12c179f 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -689,6 +689,7 @@ sub possible_duplicates { # user is not a member of the timetrackinggroup. # C<deadline> - For time-tracking. Will be ignored for the same # reasons as C<estimated_time>. +# C<flags> - An array of flags that will be applied to the bug. sub create { my ($class, $params) = @_; my $dbh = Bugzilla->dbh; @@ -724,6 +725,7 @@ sub create { my $is_markdown = delete $params->{is_markdown}; my $see_also = delete $params->{see_also}; my $comment_tags = delete $params->{comment_tags}; + my $flags = delete $params->{flags}; # We don't want the bug to appear in the system until it's correctly # protected by groups. @@ -806,6 +808,14 @@ sub create { delete $bug->{_update_ref_bugs}; } + # Apply any flags. + if (defined $flags) { + $bug->set_flags($flags); + foreach my $flag (@{$bug->flags}) { + Bugzilla::Flag->create($flag); + } + } + # Comment #0 handling... # We now have a bug id so we can fill this out |