Add Customer User to Ticket with perl script

Moderator: crythias

Post Reply
Markusnoob2
Znuny newbie
Posts: 17
Joined: 27 Feb 2020, 12:34
Znuny Version: OTRS5
Real Name: markus

Add Customer User to Ticket with perl script

Post by Markusnoob2 »

Hello,

to Add a new user via script i can use the following statement:

otrs.Console.pl Admin::CustomerUser::Add --user-name ... --first-name ... --last-name ... --email-address ... --customer-id ... [--password ...]

But i want to Set a Customer to a Ticket.
Something like this:
otrs.Console.pl Admin::TicketUser::Add --ticket --user

Is there a possibility to do this whitout making raw sql querys?

Thank you for your answer
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Add Customer User to Ticket with perl script

Post by root »

Hi,

No there is no command line part for this and I strongly advised do not use queries to update the database directly. You will mess with the cache. Use instead a web service to assign a customer user to a ticket.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
Markusnoob2
Znuny newbie
Posts: 17
Joined: 27 Feb 2020, 12:34
Znuny Version: OTRS5
Real Name: markus

Re: Add Customer User to Ticket with perl script

Post by Markusnoob2 »

Thanks for the answer. Yeah, i already had a bad experience with raw queries.

Do you have any link of a documentation for using the web service?
I am using OTRS 5

thank you
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Add Customer User to Ticket with perl script

Post by root »

Markusnoob2 wrote: 18 Jan 2022, 22:09 Thanks for the answer. Yeah, i already had a bad experience with raw queries.

Do you have any link of a documentation for using the web service?
I am using OTRS 5
Hi,

Technically it's an ticket update when you like to set a customer user. Here is a description for required operation and the payload:
https://doc.znuny.org/doc/api/otrs/6.0/ ... te.pm.html

A JSON Payload would look like this:

Code: Select all

{
  "UserLogin": "AgentWIthAccessToTheTicket",
  "Password": "YourExtremlySecretPassword",
  "Ticket": {
    "CustomerID": "02",
    "CustomerUser": "jd"
  },
}
- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
Post Reply