3 Replies · Latest reply on Oct 3, 2017 6:25 PM by Mike Allen

    Add a script function to posts

      Sorry if this has been requested in the past, but I would like to see a a mini script editor that can be embedded into a post added to the site.   This would be very beneficial for those who are trying to share javascript snippets and would retain code formatting for easier reading.

       

      Example:

       

       

      instead of:

       

      (function calculatedFieldValue(current) {

       

      var gr = new GlideRecord("task_sla");

      gr.addQuery('task', current.sys_id;

      gr.setLimit(1);

      gr.query();

      if (gr.next()) {

      if (gr.business_percentage < 50) {

      return 'SLA Met!';

      }

      else if (gr.business_percentage < 100) {

      return 'SLA Risk!';

      }

      else {

      return 'SLA Breach!';

      }

      }

       

      })(current);