How can I populate custom fields which we have added to requests, through maileater?

Document ID : KB000054326
Last Modified Date : 14/02/2018
Show Technical Document Details
Description:

I have added some custom fields to the "cr" table, and I need to be able to populate them with information when a request is logged through the maileater interface (in this example, I've added a STRING(30) field called "zunit"). I've sent an e-mail to the correct maileater e-mail address, with the following contents:

Subject: request

%category=Email
%priority=4
%zunit=Support
%description=E-mail not working.

but the e-mail which is returned by maileater contains the following error:

AHD58021: Successfully Created Request 494.

AHD58041: Invalid Input (%zunit=Support). Input will be ignored.

How do I configure maileater so that the ticket is opened with the information that is needed?

Solution:

The maileater process sends the body of the incoming e-mail to the Text API for processing. The behavior of the Text API is controlled by the file %NX_ROOT%\site\text_api.cfg. Each ticket type has its own entry in this file. Keywords are defined for each field that can or needs to contain a value when the ticket is opened.

Each keyword defined has a conversion method.
The same applies to fields that establish a relationship with other tables.
You just need to check if any of the existing ones apply to your field.
For simple field types there is not a conversion method. You just need to reference the field name and the type.

For lookup fields it is necessary to check which conversion method applies.

This information can be found in the Administration Guide, Chapter 12. "Using the Text API", you will find 'Conversion Methods' on page 435.

For example, for the Organization table the following method is defined:

Method Output Type
lookup_org STRING

So, in this case, search for the following block in text_api.cfg file:

#   
#########################################################################   
# KEYWORDS:   
#   
# Below define valid keywords that can be used. Use keywords to map   
# input value to name in .maj files. If the input value needs to be   
# converted, you can use an optional method to do the conversion.  

This is the start of the section which determines which fields in the "cr" table can be seen (and therefore updated) by the Text API. To add the custom field, add it after this section, so this section now looks like this:

REQUEST.TYPE=type.STRING
REQUEST.URGENCY=urgency.INTEGER.lookup_urgency
REQUEST.URGENCY_PERSID=urgency.INTEGER.lookup_urgency_by_persid
REQUEST.ZUNIT=zunit.STRING

Then recycle Service Desk Services so the change is recognized and add %zunit=<add the organization name here> to the message body.

Additional Information:

  • The same rule applies to field types such as String and numbers.
  • You can find complete information on working with Text API in R12.5 in the Service Desk Administration Guide, Chapter 12. Using the Text API.
  • For the other Service Desk releases (11.2 and 12.1), refer to the correspondent Administration Guide.