/build/static/layout/Breadcrumb_cap_w.png

How to make a quick ticket (close ticket on save)

I was looking for a how to so that I didn't have to reinvent the wheel, but since this hadn't been answered previously, I had to figure this out. While one could probably do something a little more ornate this one is specifically for password resets, since those are often repeated over and over again. If you have downloaded MySQL Workbench, it will help you establish some of these values easier than without it.

This will allow my users to creating and closing a ticket by only entering the following information and clicking Save:

Title / Category / Requestor / Owner

Disclaimers: This code and how to is provided as is, just trying to help out fellow techs. I cannot support this or take responsibility if you damage your system. If you are familiar with SQL this can be modified to do some pretty nice things.

This is working on K1000 v 5.5.90549 I don't know about later versions because I haven't upgraded yet and didn't try it on earlier versions.

 

To get this working I did the following:

In the Queue in question, I created the following "Category Values"

Password Reset::Quick Close Active Directory

Password Reset::Quick Close Core System

Password Reset::Quick Close Other Systems

You could do this for any other system and you could also leave a non quick close version in there for tickets that perhaps you needed more information for.

Next I added a Status Value of "Quick Close" and made its state "closed"

Now, the fun stuff the custom ticket rules:

Create a new custom ticket rule as follows:

Title: Quick Close Password Resets

Order: 100

Queue (whichever queue you added the above category fields)

Frequency "on IT Request Save"

Enabled box checked

Select Query:

SELECT HD_TICKET.ID from HD_TICKET
JOIN HD_CATEGORY HD_C on HD_C.ID = HD_TICKET.HD_CATEGORY_ID
JOIN HD_STATUS HD_S on HD_S.ID = HD_TICKET.HD_STATUS_ID
WHERE HD_C.NAME LIKE '%Password Reset::Quick Close%' AND HD_S.NAME NOT LIKE 'CLOSED' AND HD_TICKET.HD_QUEUE_ID = 4

Note the highlighted portion of the last bit of code. I want this to ONLY look at the IT Request Queue. To find out what queue number this is, when you select "configuration" then queues, if you hold your mouse over the name of the queue, you will see the ID at the very end of the URL. You could also see this if you run the following query in MySQL Workbench:

select ID, NAME from HD_QUEUE

The ID that corresponds with your queue name is what you'd want to enter here.

 

Next I checked the box for "Run an Update Query using the results from the one above"

update HD_TICKET
set
RESOLUTION = 'Password Reset per procedure and user request',

HD_STATUS_ID = ,
TIME_CLOSED = NOW()
where HD_TICKET.ID = ;

 

HD_STATUS_ID is what we need to update to close the ticket, this number corresponds the the "Quick Close" status we created earlier. If you have SQL Workbench

Run the following Query:

select * from HD_STATUS
WHERE HD_QUEUE_ID = 4 and NAME LIKE "Quick Close"

If you do not have MySQL Workbench you can achieve the same result by creating a new SQL report in the K1000 and when you run it, it will provide you with the same information.

Once you have this in place you can test it by creating a ticket and setting the title, the category to one of the quick close fields and setting your submitter, and owner. Once you click "save" if you refresh the ticket you should see it's status shows "quick close" and resolution should say "Password reset per procedure and user request"

Edit: I found out that some of the reports failed to work on these. In order to prevent that Issue I had to add the TIME_CLOSED = NOW() function

Hope this helps some of you out there.

 


1 Comment   [ + ] Show comment
  • Great post!

    Might consider moving this over to a blog to make it easier to find for folks :) - erik.ragan 9 years ago

Answers (0)

Be the first to answer this question

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