If you are working within multiple instances and multiple developers you might have faced already an issue in the past when you deploy update sets from one instance to another that you missed to collect the manual deployment steps that have to take place before or after comitting the update set.
As I have experienced the same, especially when doing a monthly or quaterly release from QA to PROD it is difficult to remember what has been done so far in the respective update sets. You might ask the developers or invest a lot of time during or after the release to fix the issues.
You can skip the rest of the post to download the solution update set if you don’t want to read the rest of the article.
Options to collect manual deployment steps
I did not want to run again into such an issue where I forgot to apply manual deployment steps so I thought about options how I can collect all information of these steps and put them into the batch update set for the release:
- Write steps into the description of the update set
- Pro: No big customization needed, field could get a default value
- Contra: If batch update set contains a lot of child update sets it will be some time effort to collect all the manual steps.
- Write steps into specific fields in the update set
- Pro: Easier to identify instead of having one field for BEFORE and AFTER deployment tasks it is separated into two fields.
- Contra: Manual effort to collect and concatenate the field information into the batch update set
- Write steps into specific fields and collect them automatically in the batch update set
- Pro: Easier to identify instead of having one field for BEFORE and AFTER deployment tasks it is separated into two fields.
- Contra: Small Client Script needed
Because I’m a lazy developer I decided to go with Option #3. The customization is not too big also that clients won’t install it and it really saves a lot of time for future releases.
Solution for collecting manual deployment steps in update sets
The solution is quite simple. All you need:
- Create new field on sys_update_set form: Manual steps BEFORE deployment
- Create new field on sys_update_set form: Manual steps AFTER deployment
- Create a Client Script that collects the content of the new fields and concatenate them from each child update set.
I added two strings fields with maximum of 4000 chars. This should be ok, except the releases are containing a lot of update sets that have a lot of manual steps. My experience so far with a monthly release process is, that there is never that much content that needs to be done manually.
The two new fields are placed directly under the description on the form, but you are free to add them wherever you want. Important is that they are visible to the developers so they can add and read the steps.
In the above screenshot you can already see the content on the batch update set. So the form is consistent and the script will only collect information of added child update sets. The client script will include the update set name as well just in case you need a reference. This can be easily adjusted in the code if you just need to have the steps itself.
Table: sys_update_set
Type: onSubmit
Script:
function onSubmit() { //Create variables and Glide Record Query var combinedBefore = ''; var combinedAfter = ''; var gr = new GlideRecord('sys_update_set'); gr.addQuery('parent',g_form.getUniqueValue()); gr.query(); //Loop through all update sets and concatenate manual step fields while(gr.next()){ if(gr.getValue('u_manual_steps_before_deployment') != ''){ combinedBefore = combinedBefore + '\n\n' + 'Update Set: ' + gr.getValue('name') + '\n' + gr.getValue('u_manual_steps_before_deployment'); } if(gr.getValue('u_manual_steps_after_deployment') != ''){ combinedAfter = combinedAfter + '\n\n' + 'Update Set: ' + gr.getValue('name') + '\n' + gr.getValue('u_manual_steps_after_deployment'); } } if(combinedBefore != ''){ g_form.setValue('u_manual_steps_before_deployment',combinedBefore); gr.update(); } if(combinedAfter != ''){ g_form.setValue('u_manual_steps_after_deployment',combinedAfter); gr.update(); } }
You can download the complete solution directly from the ServiceNow Developer Share.
If you need help on deployment: tutorial: how to install update sets from tlgr or other sources?