Bug 489536 - when creating bug via xmlrpc, customer-facing has a null valie
when creating bug via xmlrpc, customer-facing has a null valie
Status: CLOSED CURRENTRELEASE
Product: Bugzilla
Classification: Community
Component: Creating/Changing Bugs (Show other bugs)
3.2
All Linux
low Severity medium (vote)
: ---
: ---
Assigned To: Noura El hawary
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-10 12:16 EDT by Vincent Danen
Modified: 2013-06-24 00:07 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-03-19 03:55:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
in xmlrpc bug creation set the value of cf_cust_facing to '---' if it was not set by user (1.19 KB, patch)
2009-03-13 08:53 EDT, Noura El hawary
dkl: review-
Details | Diff

  None (edit)
Description Vincent Danen 2009-03-10 12:16:38 EDT
Creating a bug via an external script using the XMLRPC api, no value is set by default for the "customer facing" field.  It should probably set the default value of '---' as an actual default when bugs come in this way, rather than an empty string.  As a result, we see a lot of mails where the sole change is:

>           What    |Removed                     |Added
>----------------------------------------------------------------------------
>    Customer Facing|                            |---
Comment 1 Noura El hawary 2009-03-13 08:53:58 EDT
Created attachment 335086 [details]
in xmlrpc bug creation set the value of cf_cust_facing to '---' if it was not set by user

Patch that will set the value of cust facing to '---' if it was not set when creating bugs through xmlrpc interface to avoid all those emails that gets sent to the user about cust facing change to --- if it was not set, this problem is not in the GUI of enter bug because the bug entry form GUI prefill the form value by with '---'.

Noura
Comment 2 David Lawrence 2009-03-13 11:08:06 EDT
Comment on attachment 335086 [details]
in xmlrpc bug creation set the value of cf_cust_facing to '---' if it was not set by user

This is not the correct way to fix this unfortunately. If you look at line 130-131 in Bugzilla/Field.pm, and new FIELD_TYPE_SINGLE_SELECT custom fields created through the web UI will automatically have a default value of '---' when new bugs are created.

The cf_cust_facing field was migrated manually from the old 2.18 database and did not get the default set properly. 

Please send email to eng-sysadmin to run the following command on the live database:

mysql> alter table bugs modify cf_cust_facing set default '---';

As the only other single select field is target_release and it already has the proper default, cust_facing is the only one we need to fix.

Dave
Comment 3 David Lawrence 2009-03-13 16:48:19 EDT
After thinking some more we should go ahead and fix the ones that are not set properly in the database that already exist.

Something like:

mysql> update bugs set bugs.cf_cust_facing = '---' where bugs.cf_cust_facing not in (select cf_cust_facing.value from cf_cust_facing);

Dave
Comment 4 Noura El hawary 2009-03-18 05:27:50 EDT
Hey Dave,

Yeah that solution i guess is the right way for fixing the issue , sending an email to sys-admins to run the following queries:

1- query to change the bugs table
mysql> alter table bugs alter column cf_cust_facing set default '---';

2- query to set all bugs with cf_cust_facing values other than ---, No, Yes to the default ---
mysql> update bugs set bugs.cf_cust_facing = '---' where bugs.cf_cust_facing
not in (select cf_cust_facing.value from cf_cust_facing);

Thanks
Noura
Comment 5 Noura El hawary 2009-03-18 05:28:49 EDT
Note I have made sure that this works fine on bz-db1
Comment 6 Noura El hawary 2009-03-19 03:55:40 EDT
That should be fixed now.

Noura

Note You need to log in before you can comment on or make changes to this bug.