rithesh
Kilo Expert

 

Writing internal documentation has always been a hard step in any project. Many enterprises still struggles on this area. As a developer myself, I am not a big fan of writing documentation. But after delivering a couple of successful projects, I realized the importance of a good documentation especially if I’m taking over existing projects from team-mates. I developed an easy approach to automate documentation process where ServiceNow Developers can have documentation of the work they’ve done without the need of them spending time in writing it.


This post is divided into two parts, part-1 covers how to automate the process and part-2 covers future goals on this aspect.

“Documentation is a love letter that you write to your future self. — Damian Conway”

 

Part — 1: The beginning, Update the Update Set

Below is the flow I created to update the ‘Description’ of Update Set with captured changes

find_real_file.png

  • Flow Triggers when state changes to ‘Complete’ on sys_update_set table and below two actions need to be taken
  • Action 1: Look up for Customer Updates(sys_update_xml) related to the current update set
  • Action 2: While loop runs for each Customer Update Record, and retrieves data related to updated record. Refer to the below code.
var currDesc = fd_data.trigger.current.description;var updateDesc = currDesc+’ \n ‘+fd_data._3__for_each.item.action+’ applied on ‘+fd_data._3__for_each.item.table+’ ‘+fd_data._3__for_each.item.type+’ ‘+fd_data._3__for_each.item.target_name+’\n’;
return updateDesc;
  • Basically this process is generating text from keywords
  • Updates the Description on Update Set with updateDesc

After applying above simple changes, update set looks like this when you close it.

find_real_file.png


Part — 2: Future Goals

  • Capturing if its specific INSERT or UPDATE
  • Updating text to generic Language like
    Converting current text “DELETE applied on variable test var2” to “Deleted variable test var2 on Incident Table”
  • Integrating ServiceNow to other third party documentation tools like Quip, Google Docs, OneNote etc to export documentation from ServiceNow
  • Using Deep Learning Language models, convert Javascript code to summary text in English
  • Upload the project into ServiceNow Store

I would appreciate if you share your thoughts and feedback on this project. Also, if any one is interested in this work and would like to collaborate please send me a message in My LinkedIn.

Version history
Last update:
‎02-14-2021 03:48 PM
Updated by: