/build/static/layout/Breadcrumb_cap_w.png

Add KB Article Links to comments in tickets

I created this rule since I wanted a way to send the users a KB article that has HTML or markup in it. Currently the system would post the html code in a comment if using the KACE built in KB article lookup. So here's the steps I took to do this....

1. Go to the Service Desk Module > Configuration > Queues > "Specific Queue" > Queue Customization

2. Add a Single Select custom field with select value of query: select TITLE from ADVISORY and nothing in the default box.

3. Click Save and Continue

4. Edit the custom field in the Ticket Layout with the name KB Article Link and make it Owner Only - Hidden from User

5. Keep track of the custom field value. For example: CUSTOM_6 

6. Go to Service Desk Module > Configuration > Rules > "Specific Queue"

7. Click on Choose Action...  and choose New (SQL)

8. Name: KB Article Rule Insert. (Or whatever else you wanna call it)

Select Query:

select distinct(HD_TICKET.ID) from ADVISORY A, HD_TICKET

left join HD_TICKET_CHANGE on HD_TICKET_CHANGE.ID = <CHANGE_ID>

where HD_TICKET.CUSTOM_FIELD_VALUE5 = A.TITLE   <--- Custom Field Number - 1 (CUSTOM_6 = CUSTOM_FIELD_VALUE5)

and HD_TICKET.HD_QUEUE_ID = 1   <--- INSERT QUEUE ID HERE

and HD_TICKET_CHANGE.HD_TICKET_ID = HD_TICKET.ID

Update Query:

update HD_TICKET, HD_TICKET_CHANGE, ADVISORY

set HD_TICKET_CHANGE.COMMENT = concat("http://KBOXURL/userui/advisory_detail?ID=", ADVISORY.ID),

HD_TICKET.CUSTOM_FIELD_VALUE5 = ''  <--- Custom Field Number - 1 (CUSTOM_6 = CUSTOM_FIELD_VALUE5)

where HD_TICKET.HD_QUEUE_ID = 1  <--- INSERT QUEUE ID HERE

and ADVISORY.TITLE = HD_TICKET.CUSTOM_FIELD_VALUE5   <--- Custom Field Number - 1 (CUSTOM_6 = CUSTOM_FIELD_VALUE5)

and HD_TICKET_CHANGE.HD_TICKET_ID = HD_TICKET.ID

and HD_TICKET_CHANGE.ID = <CHANGE_ID>

and HD_TICKET.ID in (<TICKET_IDS>)

Schedule: On Ticket Save


9. As an owner you can go to the drop down in the ticket detail view and select a KB article you want to send to the user. When you save the ticket it will add a comment with a link to the KB article.


If you need help getting the queue ID make sure you are using KBOXaddress/adminui and go to the queue settings. You will see at the top it will say something like: queue.php?ID=1 meaning that is queue #1


Comments

  • This is great - looking forward to implementing it myself. Thanks! - jfrank 6 years ago
  • I tried to follow this, when i save it it posting this to the comments " Changed 'KB Article Link' from "''" to "'SMTP: DelayedAck error relaying email internally'". No link. we used custome_7 so i put custome_field_value6. I think i did that right? I'm not a SQL guy - ecszone 5 years ago
    • You should see that part but it should also have inserted a link in the comments. Make sure you have copied the proper lines in the Update SQL area, specifically the one with the concat statement in there. It's rare but it happens sometimes that CUSTOM_6 won't match up with CUSTOM_FIELD_VALUE5. You'd have to use MySQL Workbench to find that out though. - h2opolo25 5 years ago
This post is locked
 
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