/build/static/layout/Breadcrumb_cap_w.png

Ticket rule question

Is there a way to reference a field in Assets when creating a ticket rule?
I'd like to create a custom field in Assets that is for the number of repairs a computer has had, and then have a custom ticket rule that fires off an email when that field is modified.
Possible?

Thanks!,

Jesse

0 Comments   [ + ] Show comments

Answers (6)

Posted by: GillySpy 12 years ago
7th Degree Black Belt
0
You're better off using an email alert to monitor that field (reporting->email alert) but it could be done using rules. It would require SQL that the rule wizard cannot generate and would be different on every kbox. Take a look at email alerts and report back.
Posted by: JesseLara 12 years ago
Orange Belt
0
Nice!, I didn't think of doing it that way. Seems an easier route to do the same thing.
As always, thanks!

Jesse
Posted by: JesseLara 12 years ago
Orange Belt
0
So I gave this a shot, and although it works "as advertised", the issue I think I'm going to have is how the reports are delivered. I was hoping to be able to set a field for number of repairs a computer has had, and then have the system email someone to let them know, "this is the 1st repair on this CPU", or "this is the 2nd repair on this CPU", etc.....

Doing it this way limits me to run it on a schedule and I was hoping more for a "on ticket save" kind of action that would generate the email only once and not on a schedule, causing the person getting the emails to get the same email or notification over and over on the schedule.

Jesse
Posted by: airwolf 12 years ago
Red Belt
0
You can do this with ticket rules, but you definitely need to be comfortable and very familiar with your database to do this. Assets are specific to each KBOX's database, so I could write you a rule but it would require heavy modification to work with your KBOX.
Posted by: JesseLara 12 years ago
Orange Belt
0
That would be awesome of you, but I don't want to put you through the wringer trying to figure it out for me. I totally appreciate the offer. Although I'm comfortable with my KBOX, I'm not that comfortable with the database and would hate to fudge something up.

For now I could create a field in the ticket that would fire off the email that will do what I'm thinking, I would just hoping to make it a field in assets to better track it.
Posted by: airwolf 12 years ago
Red Belt
0
Actually, since asset changes aren't tracked in the database (at least changes to the fields themselves) you'll have to check the ASSET_HISTORY table and scan entries for the field name you are monitoring. In other words, you'd want a 15 minute scheduled job to check for changes within the past 15 minutes that have occurred to your field. An OTS rule will not work, because OTS has nothing to do with asset table changes. You would want "On Asset Change" - which unfortunately doesn't exist. Anyway, I digress.

Try this. Setup a job to run every 15 minutes as follows. The only parts you'll have to change are the ASSET_DATA_5 table (to find the correct number, go to your asset type and you'll see the ID in the URL), the %field_name% part, and the email address at the beginning of the select query. Just wrap the field's name in percent symbols (%) - these are wildcards in MySQL. So this rule is basically saying, "find me all assets of this type where a specific field shows up in asset history in the past 15 minutes..." which means the field changed. It will then send an email to the specified address in the query for each result.

Select Query:
select A.NAME as 'Name', 'user@domain.com' as EMAIL from ASSET A
join ASSET_DATA_5 AD on (AD.ID = A.ASSET_DATA_ID)
join ASSET_HISTORY AH on (AH.ASSET_ID = A.ID)
where AH.DESCRIPTION like '%field_name%' and TIME_TO_SEC(TIMEDIFF(AH.TIME, NOW())) < 900


Check the box that says, "Send an email for each result row," and make sure you put "EMAIL" without quotes as the email column. You can write whatever subject and body you want. You can use $name as a variable to tell you the asset name in the subject or body of the email.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

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