summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/issue-api-key.pl11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/issue-api-key.pl b/scripts/issue-api-key.pl
index c5bdd8ca4..35abb9200 100755
--- a/scripts/issue-api-key.pl
+++ b/scripts/issue-api-key.pl
@@ -26,8 +26,15 @@ my $login = shift
my $description = shift;
my $user = Bugzilla::User->check({ name => $login });
-my $api_key = Bugzilla::User::APIKey->create({
+
+my $params = {
user_id => $user->id,
description => $description,
-});
+};
+
+if ($description && $description eq 'mozreview') {
+ $params->{app_id} = Bugzilla->params->{mozreview_app_id} // '';
+}
+
+my $api_key = Bugzilla::User::APIKey->create($params);
say $api_key->api_key;