Automatically changing asset statuses
Hello,
Contracts have an end date and Licenses can also have an expiry date. Is there a way in KACE to automatically change the status of a contract or license to Expired once the end date/expiry date has passed?
- Richard
Answers (2)
You would have to create a ticket rule to change the status. It should be quite straightforward if it is just a single asset type such as a License, if the expiry date is in the asset field, just set the SELECT statement to select an asset record (id) when the asset type is license and the expiry date is less than “now”.
Then set the asset status id field to the expired asset status I’d and schedule the rule to run once a day.
If you use the maintenance expiry date in the licenses Asset type, then your rule should look something like this
Select Statement
SELECT ASSET.ID,
ASSET.ASSET_DATA_ID,
ASSET_DATA_7.ID,
ASSET_DATA_7.FIELD_7,
ASSET.ASSET_STATUS_ID
FROM ASSET ASSET
INNER JOIN ASSET_DATA_7 ASSET_DATA_7
ON (ASSET.ASSET_DATA_ID = ASSET_DATA_7.ID)
WHERE
ASSET.ASSET_STATUS_ID = '493' AND ((date(ASSET_DATA_7.FIELD_7) < curdate() ))
Update Statement
UPDATE ASSET
INNER JOIN ASSET_DATA_7 ASSET_DATA_7
ON (ASSET.ASSET_DATA_ID = ASSET_DATA_7.ID)
SET
ASSET.ASSET_STATUS_ID = "492"
WHERE ASSET.ASSET_STATUS_ID = '493' AND ((date(ASSET_DATA_7.FIELD_7) < curdate() ))
Set the rule to run every day at a set time and you should be good to go