Bug 489536

Summary: when creating bug via xmlrpc, customer-facing has a null valie
Product: [Community] Bugzilla Reporter: Vincent Danen <vdanen>
Component: Creating/Changing BugsAssignee: Noura El hawary <nelhawar>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 3.2CC: dkl, nelhawar, thoger
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-03-19 07:55:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
in xmlrpc bug creation set the value of cf_cust_facing to '---' if it was not set by user dkl: review-

Description Vincent Danen 2009-03-10 16:16:38 UTC
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 12:53:58 UTC
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 15:08:06 UTC
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 20:48:19 UTC
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 09:27:50 UTC
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 09:28:49 UTC
Note I have made sure that this works fine on bz-db1

Comment 6 Noura El hawary 2009-03-19 07:55:40 UTC
That should be fixed now.

Noura