- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2015 12:40 PM
Okay... to break down my question.
I am working with two tables, sys_user and the cmdb.
Basically, every user record in the sys_user table is assigned equipment that is stored in the cmdb table.
When a user leaves the company, their status (choice field) in sys_user changes from "Active" to "Termed"
Upon this status being changed from "Active" to "Termed", I need to change another choice field (on the users CI record) in the cmdb from "Active" to "Recover", so our team knows we need to get their equipment.
Example: John Doe is an Active Employee with Active equipment (iPad tablet) assigned to him. 3 months later, John quits so his record in the sys_user table changes from Active to Termed (via scheduled import) now his equipment status needs to change from Active to Recover - so my team knows they need to recover Johns hardware.
Whats in bold is my problem and I am looking for a way to automate these status changes. I am looking for an "out of the box" method of doing this since I have very little knowledge of javascript.
Would anyone be kind enough to point me to the right direction?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2015 02:17 PM
Hi Daniel,
Make sure that the field column name and the values are set properly in the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2015 02:54 PM
Looking further, the "Recover" choice value isnt actually in the cmdb_ci, its in another table that is extended from the cmdb_ci...
Is that relevant?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2015 02:57 PM
Daniel,
So I am assuming that only items in the extended table will be marked as recover? If yes, then just change the table (cmdb_ci) in above code to the extended table and it should work.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2015 03:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2015 12:16 PM
Daniel,
Remove the filter conditions and put this in condition instead:
current.u_employment_status.changesTo('T');
Just make sure that fieldname (u_employment_status) is correct.
Let me know how it goes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2015 01:25 PM
sumukh, thanks for all the help!
I have done as you asked, still not working. The business rule is active, though I'm not entirely sure how to see if its firing...
I have the BR set to run after a insert or update. Concerning the table, I have tried it with both cmdb_ci and with u_communication_devices, still no joy.
"Employee Status" with a choice value of T resides on the sys_user table and "Status" with a choice value of "Recover" resides on a custom "u_communication_devices" table, though *configure dictionary* for the Status field shows the field belonging to the cmdb_ci table
I don't expect anyone to post years of worth of javascript education on here... I was really hope for an "out of the box", easy mode solution... is there no other way do this?