Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

API - Custom Fields

Hello,

I am having an issue with submitting tickets via the API with required custom fields.

Scenario: I have created a two custom fields that ask for the users account name (short answer)  and the last time that the user used the account (choice) that are required of the user. I have added this custom form to my help topic.

Challenge: I am using a 3rd party wrapper for my ASP.NET application (I have already contacted the dev for assistance and he recommended I post here after we tried some debugging). If the fields are set to not required, the ticket goes in just fine. However, it does not include the username or lastused variable. If, they are required, it returns a error of "Unable to create new ticket: validation errors: 0: IMS Account Username is a required field 1: Last Time Used is a required field".

Attempts to debug: I have tried several things but the most useful data is this...I installed Fiddler2 and began to inspect the JSON requests that were being sent from my application to the OSticket API system. Here is the RAW data from my JSON request to the server's API:
{
  "email": "WebAppOSTicket@example.com",
  "name": "Joe Smith",
  "subject": "Computer Bug",
  "message": "data:text/plain,This is a test of the API System",
  "priority": 3,
  "topicId": 15,
  "attachments": [],
  "imsusername": "ZZ12345",
  "imslastused": "over90days"
}

Everything looks to be going to the system correctly but it is not interpreting my request correctly or something else is wrong.

Things to Note:
  • I can submit a basic ticket that has not required fields (aka the stock form)
  • I was able to successfully submit a ticket using the "phone" example in the documentation provided by the osticket team
System Info:
Server Information
osTicket Versionv1.9.2 (4827655)
Server SoftwareApache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9
PHP Version5.5.9
MySQL Version5.6.16

Please help me. This is driving me crazy. I have tried everything I can think to try.
Tagged:

Comments

  • Sorry but I have only played with PHP to use the API.  

    I can tell you that the variable names are case sensitive so check in Admin panel -> Manage -> Forms -> your form and make sure that imsusername is the same case.
  • edited June 2014
    Sorry, the programming language is irrelevant because I am sending the correct JSON request. I was just trying to be detailed.

    I did a direct copy and paste of the variable name and it still didnt work.

    If you put it in the built-in ticket details ticket form fields then everything works fine. But if I make a custom form and assign it to a help topic, it does not work.

    I have read several posts online that said this was an issue in 1.8 as well. Greezybacon even said in the issue on github that he had heard of the issue before but never took the time to look at it.

    This is the last piece of the puzzle that we need in our project to be able to use OSTicket for our ticketing system. Without it, due to our unique customers, we will not be able to use the system and so far I have fallen in love with how this system works.

    I will assist in whatever way is needed to help debug and fix this problem. I just don't have the PHP expertise to make changes and debug on my own. I'm normally a C# / Java developer.
  • edited July 2014
    I have not heard back about this and after more testing I submitted an issue on the GitHub repo as well...#1083
Sign In or Register to comment.