diff options
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 |