We are working on an interface between ost and another system. What we are needing to do is to create a new User record directly using SQL.We have created some custom fields for Users (using Manage > Forms >Contact Information). We have ascertained that there are three database tables associated with Users (ost_user, ost_user_email, ost_user__cdata).The code we are using looks like this.....----------------------------------------------------------------------------------------------------
"Times New Roman"">SET @[deleted] = 'User1';
SET @[deleted] = 'User1@domain.com';
SET @[deleted] = '012345678';
SET @[deleted] = '2 Main Road, Thistown';
SET @[deleted] = 'Ourvillage';
SET @[deleted] = 'SPF1';
"Times New Roman"">
INSERT INTO osticket.ost_user VALUES(null,'0','0','0',@'username',now(),now());
SET @[deleted] = (SELECT id FROM osticket.ost_user WHERE name = @[deleted]);
INSERT INTO osticket.ost_user_email VALUES(null,@x,'0',@'useremail');
SET @[deleted] = (SELECT id FROM osticket.ost_user_email WHERE user_id = @[deleted]);
UPDATE osticket.ost_user SET default_email_id = @[deleted] WHERE id = @[deleted];
INSERT INTO osticket.ost_user__cdata
(user_id,phone,address,village,accesspoint)
VALUES(@x,@'phone',@'address',@'village',@'accesspoint');
"Times New Roman"">---------------------------------------------------------------------------------------------------------------
"Times New Roman"">Running this code successfully creates a User record in the database with all the expected field values.
"Times New Roman"">Viewing the actual tables clearly shows the correct values.
In osTicket, viewing the User list will show the new User record.However, when hovering over the new Username the popup form that should show the field values is blank (only showing Username and email address)Basically all the values in ost_user__cdata are missing (even though they show as there in the database)The same applies to editing the values - the form is empty. In edit, if any values are entered for one or more fields then they are saved to the database and all the values on the cdata record are overwritten. This can be seen in a database search and the values also then show in the ost view as well.We are at a loss to understand what is going on. It seems that maybe there is something missing from the original creation of the record that causes the custom field values to not be seen (a flag somewhere maybe?)Is there anyone out there who could give us an idea of what we might be missing? Or maybe suggest alternative SQL to create a user.RegardsRichard