[SOLVED]Enalbe Dynamic Field in AgentTicketBulk

Moderator: crythias

Locked
jeremyk
Znuny newbie
Posts: 21
Joined: 18 Jul 2013, 15:29
Znuny Version: 3.2.8
Real Name: Jeremy Kessous
Company: DataMotion

[SOLVED]Enalbe Dynamic Field in AgentTicketBulk

Post by jeremyk »

ndhvu275 wrote:
crythias wrote:Use Generic Agent to set a DynamicField for multiple tickets.
Yes,it's a nice solution. Thanks so much
Any chance you guys could point me in the right direction of not setting dynamic field for multiple tickets, but even just for one? I am trying to create a web form for customers to put in tickets, and I cannot for the life of me figure out how to pass dynamic fields into the ticket.

I have tried numerous different approaches but cannot get anything to work. I am using HTML/PHP for my form.

Thanks.
Mod: Please create a new topic for your issue
Last edited by jeremyk on 16 Aug 2013, 16:06, edited 1 time in total.
OTRS v3.2.8 running on Debian 7 with MySQL
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Enalbe Dynamic Field in AgentTicketBulk

Post by crythias »

what is the submit method for your webform? (Don't tell me get/post. Tell me how you're intending to push the form to OTRS. Email?)
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
jeremyk
Znuny newbie
Posts: 21
Joined: 18 Jul 2013, 15:29
Znuny Version: 3.2.8
Real Name: Jeremy Kessous
Company: DataMotion

Re: Enalbe Dynamic Field in AgentTicketBulk

Post by jeremyk »

crythias wrote:what is the submit method for your webform? (Don't tell me get/post. Tell me how you're intending to push the form to OTRS. Email?)

I am connecting to it via SOAP. I was using rpc.pl but I understand the Dynamic Fields in it are deprecated. I was trying to follow some instructions for adding it back in, and I can get a ticket submitted no problem, I can get it trying to use the Dynamic Field without giving me any error, however it just does nothing now. I know I am supposed to use the Generic Interface now and create a web service, my biggest issue with that, is simply that I cannot find all the proper information I need to create the web interface properly, and then the syntax to properly call it from my webform.

Here is the PHP code I am trying to work with:


<?php

if ($_POST != null){


echo "<br>";
echo "<br>";




$client = new SoapClient(null, array(

'location' => "http://otrs.datamotion.com/otrs/rpc.pl",
'uri' => "Core",
'trace' => 1,
'login' => "xxxxxx",
'password' => "xxxxxx",
'style' => SOAP_RPC,
'use' => SOAP_ENCODED
));


$ticketnumber = $client->__soapCall("Dispatch", array("xxxxxx", "xxxxxxx", "TicketObject", "TicketCreateNumber"));
echo "Thank you for submitting a ticket, your Ticket Number is: ".$ticketnumber."<br>";
echo $_POST["company"];
$DynamicID = '10';
$CompName = 'Test Company';
echo $DynamicID;



$ticket = $client->__soapCall("Dispatch", array("xxxxxxx", "xxxxxxx", "TicketObject", "TicketCreate",
"TN" , $ticketnumber,
"Title" , $_POST["subject"],
"Queue" , 'Support',
"Lock" , 'unlock',
"Priority" , '3 normal',
"State" , 'new',
"Type" , 'default',
"Service" , '',
"SLA" , '',
"CustomerID" , $_POST["emailAddr"],
"CustomerUser" , $_POST["emailAddr"],
"OwnerID" , 1,
"ResponsibleID" , 1,
"UserID" , 1,
));

$article = $client->__soapCall("Dispatch", array("xxxxxx", "xxxxxx", "TicketObject", "ArticleCreate",
"TicketID" , $ticket,
"ArticleType" , 'email-external',
"SenderType" , 'customer',
"From" , $_POST["emailAddr"],
"To" , 'otrs@xxxxxxx.com',
"Cc" , '',
"ReplyTo" , '',
"Subject" , $_POST["subject"],
"Body" , $_POST["description"],
"MessageID" , '',
"ContentType" , 'text/plain; charset=utf-8',
"HistoryType" , 'OwnerUpdate',
"HistoryComment" , 'No History',
"UserID" , 1,
"NoAgentNotify" , 1,
"AutoResponseType" , 'auto reply',
"ForceNotificationToUserID" , 1,
"OrigHeader", array(
'From' => $_POST["emailAddr"],
'To' => 'otrs@xxxxxxx.com',
'Subject' => $_POST["subject"],
'Body' => $_POST["description"]
),
)
);

$companyname = $client->__soapCall("Dispatch", array("xxxxxx", "xxxxxx", "TicketDynamicObject", "ValueSet",
"FieldID" , "10",
"ObjectType", 'Ticket',
"ObjectID", $ticket,
"Value", array(
"ValueText", $_POST["company"]),
"UserID", 1,
));


}

?>
OTRS v3.2.8 running on Debian 7 with MySQL
jeremyk
Znuny newbie
Posts: 21
Joined: 18 Jul 2013, 15:29
Znuny Version: 3.2.8
Real Name: Jeremy Kessous
Company: DataMotion

Re: Enalbe Dynamic Field in AgentTicketBulk

Post by jeremyk »

Alright, so I have got my form properly putting in tickets with dynamic fields included. There is just one last issue I am having. Basically if the email address I am putting in the ticket from is not already an existing customer in otrs, it is not populating the customerID field, so I cannot see who the customer is other than the from field in the ticket.


Is there any way that I can get around this. Interestingly, when using rpc.pl, even if the customer did not exist in OTRS, the email address was getting filled in for the customerID field.

Any ideas?
OTRS v3.2.8 running on Debian 7 with MySQL
Locked