Change CustomerID in Ticket after the Customer User is created

Moderator: crythias

Locked
omikron
Znuny newbie
Posts: 6
Joined: 26 Mar 2015, 11:22
Znuny Version: 4.0.6

Change CustomerID in Ticket after the Customer User is created

Post by omikron »

Hello,
I want to implement the following configuration:
1. A new email creates a ticket in OTRS. Neither company user nor the company exist in OTRS. The ticket is created with customer_id=customer_user_id=email.
2. I create the customer and customer user.
3. If I open the ticket now - I can see the correct customer information in the box left. But the customer_id is of course not being changed and it remains email.

What is the best way to reassign the email-customer_id in the ticket table to the correct customer_id from the customer_user table?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Change CustomerID in Ticket after the Customer User is created

Post by crythias »

Click customer and search for the user again. It will fixup the issue.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
omikron
Znuny newbie
Posts: 6
Joined: 26 Mar 2015, 11:22
Znuny Version: 4.0.6

Re: Change CustomerID in Ticket after the Customer User is created

Post by omikron »

Hello crythias,
do you mean on ticket zoom screen? The button above? Yes, I know, that it works.

But I want somehow to automate it. I want to add just the company_user and I want that OTRS automagically changes the customer_id in the ticket.
My idea is to use a SQL script, which is being started by cron every minute.

But I would like to have an OTRS solution to it. Is it maybe possible to implement it using Generic Agent?n
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Change CustomerID in Ticket after the Customer User is created

Post by crythias »

omikron wrote:My idea is to use a SQL script, which is being started by cron every minute.
Sounds like a lot of overhead for that one instance that something changes ...

I can't recommend something automated in this case. I can't guarantee that the automation does exactly what is required perfectly but maybe someone else has an option.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
omikron
Znuny newbie
Posts: 6
Joined: 26 Mar 2015, 11:22
Znuny Version: 4.0.6

Re: Change CustomerID in Ticket after the Customer User is created

Post by omikron »

Is this case study so unique? If I don't change this customer_id to the real customer_id then all the stats get wrong. And even worse - the ticket shows the customer information, but the ticket remains not assigned to the customer.

What the strategy can you recommend to map the tickets to the customers after the tickets are created? Deny tickets from unknown emails?

I have tried with the SQL script, it works almost well... The date is changed, but the Frontend shows the old data. As I understand it depends on cache. Is it possible to make the same (copy customer_id from customer_user to customer_id in ticket where customer_id=email) with GenericAgent? How can I input field Ticket.Email as the filter for customer_id?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Change CustomerID in Ticket after the Customer User is created

Post by crythias »

Mostly I'm encountering that *creating* tickets by email is fraught with multiple issues and that it ends up being more problematic than having customers create tickets via web.

Not just your case where you're receiving email tickets from non-customers, but also the case where a cc'd conversation includes your otrs email address, and all the followups to reply-all create new tickets. It's all right when the subject contains the ticket number, but otherwise, not so much.

Then there's the labeling and categorization of the ticket which is easier when you can present all the fields to the customer on a screen rather than having the agent (or a complicated set of PostMasterFilters) rework an email.

How do you do that?
1) Default postmaster queue goes to Junk
2) Junk autoresponds (Don't create tickets via email. go to our website)
3) generic agent auto delete from junk
4) followups via email don't change queue, so they are attached where the ticket sits.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Locked