VaranAwesomenow
Mega Sage
This video provides theory on a ServiceNow utility called deployment genie that provides recommendations on collisions during deployment. https://developer.servicenow.com/connect.do#!/share/contents/3287388_deployment_genie_get_recommendations_during_deployment?t=PRODUCT_DETAILS Design notes fields referencing sys_remote_update_set 1. table = customer update (sys_update_xml) column = sys_remote_update_set 2. Update set preview problem (sys_update_preview_problem) column = remote_update_set 3. table = Updateset (sys_update_set) column = remote_sys_id sys_update_preview_problem -> Type = Error or warning status = ignored, skipped, skip_collision ignored -> accept remote update skipped -> skip remote update Table = sys_remote_update_set columns = collisions Match description, missing_item_update,remote_update_set (by name not by sys_id), suggested status (status) Inputs -> Instance Name and updateset name Get recommendations For each entry of type error in preview problem table Find corresponding entry in preview problem table of lower instance A new related list gets added that will have miss_item_update, remote_update_set, Table = sys_update_preview_problem Missing item = sys_dictionary_override_4e366806871a0110 Updateset name = MyUpdatesetNew description = Found a local update that is newer than this one type = error msising item table = incident Remote update = sys_dictionary_override_4e366806871a0110 Suggested action Mapping ignored -> accept remote update skipped -> skip remote update No match -> unknown Add two custom fields on sys_update_preview_problem dryrun preview problem status, recommended action change list layout of preview problems to show recommended action column and dryrun action state system property -> deploymentgenie.dryrun.deployment.instance UI action on sys_remote_update_set table Name = Recommend actions clear recommended action field in the preview problem table Invoke subflow that will make rest api call to target instance for all preview problem records and update recommend action field Traverse through each row in the sys_update_preview_problem for a given updateset remote_update_set=5668f80a875a01102595fcc7cebb359a^status= sample response 77cb0910bf010100421cdc2ecf07399d,8b5c4910bf010100421cdc2ecf07394f,17794300bf110100421cdc2ecf0739f3,f6f5730c97410100d308124eda29758d sys_dictionary_override_4e366806871a0110 1 Found a local update that is newer than this one 2022-03-19 01:19:24 error b37830021b5e01108475ebd5624bcb05 incident https://dev107313.service-now.com/api/now/table/sys_update_xml/5a68f80a875a01102595fcc7cebb359a 5a68f80a875a01102595fcc7cebb359a adminanil https://dev107313.service-now.com/api/now/table/sys_update_xml/0a773c8e1b1e01108475ebd5624bcb4d 0a773c8e1b1e01108475ebd5624bcb4d 2022-03-19 01:19:03 https://dev107313.service-now.com/api/now/table/sys_remote_update_set/5668f80a875a01102595fcc7cebb359a 5668f80a875a01102595fcc7cebb359a adminanil ignored { "result": [ { "status": "skipped" } ] } Postman code: GET /api/now/table/sys_update_preview_problem?sysparm_query=missing_item=sys_dictionary_override_4e366806871a0110^remote_update_set.name=MyUpdatesetNew^description=Found a local update that is newer than this one^type=error^missing_item_table=incident& sysparm_fields=status HTTP/1.1 Host: dev107313.service-now.com Content-Type: application/json Authorization: Basic XXXXXXXXXXXXXXXXXXX cache-control: no-cache Postman-Token: XXXXXXXXXXXXXXXXXXXXX /api/now/table/sys_update_preview_problem?sysparm_query=missing_item=sys_dictionary_override_4e366806871a0110^remote_update_set.name=MyUpdatesetNew^description=Found a local update that is newer than this one^type=error^missing_item_table=incident& sysparm_fields=status /api/now/table/sys_update_preview_problem?sysparm_fields=status&sysparm_query=missing_item=${missing_item}^remote_update_set.name=${remote_updateset_set_name}^description=${description}^type=${type}^missing_item_table=${missing_item_table} ${missing_item} ${remote_updateset_set_name} ${description} ${type} ${missing_item_table} ^ORDERBYDESCsys_updated_on