/build/static/layout/Breadcrumb_cap_w.png

K1000 Reporting Using Custom Ticket Fields

I am trying to create a report that outlines tickets created and closed over the past seven days - this part I have....The issue is one of the fields that I want included in the report is a custom field (Custom_1) which is a location field.  On the report the column shows, but for each line the location is blank.  This is a required field so I know that the field is populated.

Here is my SQL

SELECT O.FULL_NAME AS OWNER_NAME,HD_PRIORITY.NAME AS PRIORITY,HD_STATUS.NAME AS STATUS,HD_TICKET.CUSTOM_FIELD_VALUE1 FROM HD_TICKET  LEFT JOIN USER O ON (O.ID = HD_TICKET.OWNER_ID) JOIN HD_PRIORITY ON (HD_PRIORITY.ID = HD_TICKET.HD_PRIORITY_ID) JOIN HD_STATUS ON (HD_STATUS.ID = HD_TICKET.HD_STATUS_ID) WHERE (HD_TICKET.HD_QUEUE_ID = 2) AND ((TIMESTAMP(HD_TICKET.CREATED) <= NOW() AND TIMESTAMP(HD_TICKET.CREATED) > DATE_SUB(NOW(),INTERVAL 7 DAY))) AND ((TIMESTAMP(HD_TICKET.TIME_CLOSED) <= NOW() AND TIMESTAMP(HD_TICKET.TIME_CLOSED) > DATE_SUB(NOW(),INTERVAL 7 DAY)))  ORDER BY OWNER_NAME

0 Comments   [ + ] Show comments

Answers (1)

Posted by: jverbosk 12 years ago
Red Belt
1

If the custom field is Custom_1 in the GUI, the corresponding value for it in SQL will be HD_TICKET.CUSTOM_FIELD_VALUE0 - just keep in mind it starts counting from 0 (and will therefore be one number lower) when referencing custom fields in your queries.

John


Comments:
  • Sorry, duplicate post... - jverbosk 12 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ