Mike:
Mike:For the sake of clarity, there are two bits of code here. I'm using a simplified script now to reproduce/isolate the issue. This avoids the WebRequestAgent message (which I'll have our developer correct).This log entry is from my simplified test harness. It exhibits the same issue, the agent notification seems to fire before the article is created. How did you work around this in your code? I believe the SQL Server error is also related (and explains why the notification that appears in the agent ticket zoom show "<>" for the sender, rather than OTRS).[Mon Jul 18 21:20:23 2011][Notice][Kernel::System::Ticket::TicketCreate] New Ticket [201107181032300/JSON Test] created (TicketID=13009,Queue=raw,Priority=3 normal,State=new)[Mon Jul 18 21:20:23 2011][Error][Kernel::System::Ticket::Article::ArticleLastCustomerArticle][1168] No article found for TicketID 13009![Mon Jul 18 21:20:23 2011][Error][Kernel::System::Ticket::Article::ArticleLastCustomerArticle][1168] No article found for TicketID 13009![Mon Jul 18 21:20:23 2011][Error][Kernel::System::User::GetUserData][150] Need User or UserID![Mon Jul 18 21:20:23 2011][Error][Kernel::System::User::GetUserData][150] Need User or UserID![Mon Jul 18 21:20:23 2011][Error][Kernel::System::Ticket::Article::ArticleGet][1646] No such article for TicketID (13009)![Mon Jul 18 21:20:23 2011][Error][Kernel::System::Queue::GetSystemAddress][165] [Microsoft][SQL Server Native Client 10.0]Invalid character value for cast specification (SQL-22018), SQL: 'SELECT sa.value0, sa.value1 FROM system_address sa, queue sq WHERE sq.id = ? AND sa.id = sq.system_address_id'If it helps, the relevant bits of my test harness are pasted below.// BEGIN SAMPLE// Five possible URL parameters; User, Password, Method, Object, Datavar user = encodeURIComponent(WScript.Arguments(0));var pwd = encodeURIComponent(WScript.Arguments(1));var jsonObject = "TicketObject"; // "iPhoneObject";var method = "TicketCreate"; // "ScreenActions"; "QueueView"; "TicketGet";// Create a ticket// Consider a regular object herevar customerLogin="hugh.kelley"var customerMail="hugh.kelley@xyz.com"var body="<html><table border=1><tr><td>"body text here"</td></tr></table></html>";var title="JSON Test";var data = "{\"OwnerID\":3,\"UserID\":1,\"State\":\"new\",\"Lock\":\"unlock\",\"PriorityID\":3,\"CustomerUserLogin\":\"" + customerLogin + "\",\"Title\":\"" + title + "\",\"Queue\":\"raw\",\"TicketFreeKey1\":\"TFK1\",\"TicketFreeKey2\":\"TFK2\"}";var result;//// Ticket creationresult = JsonInvoke(url, jsonObject, method, data, user, pwd);var ticketID = result["Data"];WScript.Echo(result);WScript.Echo("ticketID==" + ticketID);//// Article creationmethod = "ArticleCreate";data = ("{\"TicketID\":" + ticketID + ",\"ArticleType\":\"phone\",\"Subject\":\"" + title + "\",\"SenderType\":\"agent\",\"From\":\"" + customerMail + "\",\"Body\":\"" + body + "\",\"CustomerUser\":\"customer@otrs.montpeliertr.com\",\"Charset\":\"ISO-8859-15\",\"HistoryType\":\"AddNote\",\"HistoryComment\":\"HistoryComment\",\"UserID\":1,\"MimeType\":\"text/html\"}") ;result = JsonInvoke(url, jsonObject, method, data, user, pwd);WScript.Echo("result: " + result);// END SAMPLEHugh
On Tue, Jul 19, 2011 at 2:15 AM, Michiel Beijen <michiel.beijen@otrs.com> wrote:Hi Hugh,
Well obviously the iPhone app uses JSON to create tickets. Also, I've just worked on a project where we used a similar handle but then for the customer interface.
The thing that would be easiest to fix is that you don't have a history type defined for 'WebRequestAgent'.
Do you have some extra notification firing when creating a ticket? Creating a ticket and it's first article are two different actions, but are both atomic; i.e. you can't do them both in one go, they ARE two different actions. This should not cause issues.
--
Mike
On Mon, 2011-07-18 at 17:58 -0400, Hugh Kelley wrote:
Is anyone using JSON to create tickets?
We have some integration code using that handler and I'm seeing the following errors in the log after each new ticket.
[Mon Jul 4 15:16:48 2011][Notice][Kernel::System::Ticket::TicketCreate] New Ticket [201107041031615/john.doe ] created (TicketID=12324,Queue=Raw,Priority=3 normal,State=new)[Mon Jul 4 15:16:48 2011][Error][Kernel::System::Ticket::Article::ArticleLastCustomerArticle][1168] No article found for TicketID 12324![Mon Jul 4 15:16:48 2011][Error][Kernel::System::Ticket::Article::ArticleLastCustomerArticle][1168] No article found for TicketID 12324![Mon Jul 4 15:16:48 2011][Error][Kernel::System::User::GetUserData][150] Need User or UserID![Mon Jul 4 15:16:48 2011][Error][Kernel::System::User::GetUserData][150] Need User or UserID![Mon Jul 4 15:16:48 2011][Error][Kernel::System::Ticket::Article::ArticleGet][1646] No such article for TicketID (12324)![Mon Jul 4 15:16:48 2011][Error][Kernel::System::Queue::GetSystemAddress][165] [Microsoft][SQL Server Native Client 10.0]Invalid character value for cast specification (SQL-22018), SQL: 'SELECT sa.value0, sa.value1 FROM system_address sa, queue sq WHERE sq.id = ? AND sa.id = sq.system_address_id'. . .[Mon Jul 4 15:16:49 2011][Error][Kernel::System::Ticket::HistoryTypeLookup][6695] No TypeID for WebRequestAgent found![Mon Jul 4 15:16:49 2011][Error][Kernel::System::Ticket::HistoryAdd][6740] Need HistoryTypeID!
This came to light because tickets are not generating "raw queue" notifications (emails) to agents. The article view shows one, but it is devoid of article text.
My hunch (from reading the log above), is that the new ticket notification logic is firing before the first article can be created.
Has anyone else seen this?
Hugh_______________________________________________ OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev