Ticket rule to add a new record to an asset table- can it be done?
I have a ticket type used to request a new ERP account. I also have a KACE asset table which lists all of the ERP accounts and users they are assigned to.
I would like to have a ticket rule which, when the request for a new ERP account is completed, adds a record to the Asset table.
I have been successful in creating the ticket rule which creates the record in the ASSET table, but there is associated data in the ASSET_DATA_33 table (linked by ASSET_DATA_33.ID = ASSET.ASSET_DATA_ID. I have also been successful in appending the correct data to the ASSET_DATA_33 table, and have a ticket rule which looks in theory like it should
SELECT
Select
ASSET.ID As ID,
ASSET.ASSET_DATA_ID,
ASSET_DATA_33.ID As Asset33ID
From
ASSET_DATA_33 Inner Join
ASSET
On ASSET.NAME = ASSET_DATA_33.FIELD_10173
Where
ASSET.ASSET_DATA_ID Is Null
UPDATE
Update
ASSET Inner Join
ASSET_DATA_33
On ASSET.NAME = ASSET_DATA_33.FIELD_10173
Set ASSET.ASSET_DATA_ID = ASSET_DATA_33.ID
Where
ASSET.ASSET_DATA_ID is null and ASSET.ID in (<TICKET_IDS>)
ERROR
mysqli error: [1062: Duplicate entry '33-2199' for key 'INDEX_TYPE_DATA_ID'] in EXECUTE("Update ASSET Inner Join ASSET_DATA_33 On ASSET.NAME = ASSET_DATA_33.FIELD_10173 Set ASSET.ASSET_DATA_ID = ASSET_DATA_33.ID Where ASSET.ASSET_DATA_ID is null and ASSET.ID in (65837,65838,65839,65840,65841,65842,65843,65843)")
I am assuming that there is an index table or something that also needs to be updated...
Does anyone have an approach to doing this (that might be completely different) or a suggestion on how to tweak my current approach?
thanks
Answers (0)
Be the first to answer this question