How to update the Life cycle stage and Life cycle status stage fields if CI is retired?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2023 04:47 AM
Hi,
I have a requirement to update the fields "Life cycle state" and "Life cycle state stage" fields should be updated to "End of Life" and "Retired" simultaneously if a CI is moved to Retired state. If the install status is changed from "Retired" to any other state, Life cycle state and stage should be emptied. For this I have written a Business rule on cmdb_ci table, which is not working. Can anyone let me know why the fields were not updating with the below script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2023 11:07 AM - edited ‎02-14-2023 11:07 AM
clearValue is for GlideForm, you are working with GlideRecord here.
You are also not updating the record in the else block.
there is a lifecycle mapping, that you should use instead.