/build/static/layout/Breadcrumb_cap_w.png

Using a ticket rule to update license count?

Hey KACE people!!

I'm probably average when it comes to KACE knowledge and SQL expertise... I'm wondering if anyone has had experience with trying to have KACE count up the number of license "slots" that are taken up by devices in the Approved for Device field?? Is that even best practice? We've imported our Microsoft Office licenses into KACE, but some of our licenses have 40+ count and I'm trying to have KACE count them up so we don't have to. The weird part is I've ran the select query through MySQL workbench and it works as intended (without the select subquery), but in the Update query in KACE we get totally different results.


The select query returns the office license ID in the ASSET_DATA_7 table in the form of <TICKET_IDS>:

SELECT ASSET_DATA_7.ID

FROM ASSET_DATA_7

LEFT JOIN ASSET ON ASSET.ASSET_DATA_ID = ASSET_DATA_7.ID

WHERE ASSET.ASSET_TYPE_ID = 7


The update query is supposed to update a custom field called "Slots Remaining" but its not doing its job:

UPDATE ASSET_DATA_7

LEFT JOIN ASSET ON ASSET_DATA_7.ID = ASSET.ASSET_DATA_ID AND ASSET.ASSET_TYPE_ID=7 

LEFT JOIN ASSET_ASSOCIATION J3 ON J3.ASSET_ID = ASSET.ID AND J3.ASSET_FIELD_ID=3

LEFT JOIN ASSET A3 ON A3.ID = J3.ASSOCIATED_ASSET_ID

SET FIELD_15 = (SELECT ASSET_DATA_7.FIELD_1 - LENGTH(GROUP_CONCAT(DISTINCT(ASSET.NAME))) - LENGTH(REPLACE(GROUP_CONCAT(DISTINCT(ASSET.NAME)), ',', '') + 1))

WHERE ASSET_DATA_7.ID in (<TICKET_IDS>)


Anyone have any experience with this? Help is always appreciated!


0 Comments   [ + ] Show comments

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