What is best practices to run a background script , while updating an CI or Asset
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 02:15 AM
Hi Team.
We have some duplicates records in the system ,
we are copying data from one ci to another ci using background script
then we are making the state of unwanted ci to retired
i have done the script , i want to know the side effects which is impacting on the system to make sure everything is going smooth
my ask is when i am making the ci state to retires what other items will effect
i am updating asset record as well , what are the effects will occur while updating asset
please provide your suggestions to run fix script best practices
Thank you,
Shabbir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 09:44 AM
One thing to bear in mind is whether you want cascading Business Rules to run or not as this can cause unexpected updates if not considered.
If not, then simply stop them with the following line:
gr.setWorkflow(false);
in your script just before the .update(). (You may need to amend 'gr' depending on your new GlideRecord definition)
As always test in sub production, but with background scripts they do provide a rollback capability just ensure before you run the script that you have the Record for Rollback? option checked that way if anything goes wrong it's an easy undo.
If helpful please mark as Helpful/Correct
Regards
Paul