DevToolbox

A set of useful utilities

Star

Install Learn more

Contribute

Contribute

First of all, thanks for thinking of contributing to this project. You’re Awesome! 😍

We welcome contributions to DevToolbox by everyone.

How to report a problem

Please search issue tracker before creating a new issue (problem or an improvement request). Feel Free to add issues related to the project.

If you feel that you can fix or implement it yourself, please read a few paragraphs below to learn how to submit your changes.

Submitting Changes

  • Comment on the issue so others know you are working on the issue.
  • Fork the project
  • Install your fork on your Personal Developer Instance (PDI) with credientials (so you have write access)
  • Create Branch something-descriptive
  • Install necessary plugins for the test (e.g. CSM tests would require CSM to be installed)
  • Ensure you are in the DevToolbox scope
  • Create the test for this issue
  • Associate the test to the logical test suite
  • Test your test in your PDI
  • Commit your changes
  • Create a Pull Request

What is this?

This is a scoped app in ServiceNow to give administrators and Developers a some utililities that I found useful based on Jim Coyne’s Developer Toolbox.

Why?

  • Easy install, Easy uninstall
  • Why not?

What are the features?

Open Source Activity Formatter

If you want a better level of programmable control of the activity formatter in UI16.

Open Source Activity Formatter

Variable Parser

This is to give admins/developers a way to not depend on GlideappVariablePoolQuestionSet.

It’s really just a script include to do what I did way, way back when.

This is contained within the variableHelper Script include and here’s a sample of what it does;

// Run this
var vh = new x_8821_dev_toolbox.variableHelper();

var current = new GlideRecord('change_request');
current.get('c286d61347c12200e0ef563dbb9a71df');
var vars = vh.getVariables(current);
var printable = JSON.stringify(vars, '', ' ');
gs.info(printable);

var current = new GlideRecord('sc_req_item');
//current.get('257c82740f4b1300fc69cdbce1050ea2');
current.setLimit(1);
current.orderByDesc('sys_created_on');
current.query();
if (current.next()) {
    var vars = vh.getVariables(current);
    var printable = JSON.stringify(vars, '', ' ');
    gs.info(printable);
}
x_8821_dev_toolbox: [
 {
  "label": "Server to reboot",
  "value": "AS400",
  "order": "100"
 },
 {
  "label": "Desired date and time of reboot",
  "value": "2016-08-10 21:42:16",
  "order": "200"
 },
 {
  "label": "Reason for reboot",
  "value": "broken",
  "order": "400"
 }
]
x_8821_dev_toolbox: [
 {
  "label": "Item name",
  "value": "Make a new Tweet!  Yea this is silly",
  "order": "1"
 },
 {
  "label": "What group owns this item?",
  "value": "US Presidents Group 1",
  "order": "3"
 },
 {
  "label": "Search terms",
  "value": "twitter, tweet, tweeting, social",
  "order": "4"
 },
 {
  "label": "What process does this follow?",
  "value": "One approval and one task",
  "order": "12"
 },
 {
  "label": "Task 1 Group",
  "value": "Service Desk",
  "order": "14"
 },
 {
  "label": "Task 1 Short Description",
  "value": "Service Desk gets all the ... hard work",
  "order": "15"
 },
 {
  "label": "Task 1 Description",
  "value": "Tweet this message out at this time :(",
  "order": "16"
 },
 {
  "label": "Approval 1 Group",
  "value": "Change Management",
  "order": "22"
 },
 {
  "208934368172635": [
   {
    "label": "Question",
    "value": "What would you like to tweet?",
    "order": "5"
   },
   {
    "label": "Type",
    "value": "6",
    "order": "6"
   },
   {
    "label": "Default Value",
    "value": "",
    "order": "7"
   },
   {
    "label": "Table",
    "value": "",
    "order": "8"
   },
   {
    "label": "Reference Qualifer",
    "value": "",
    "order": "9"
   },
   {
    "label": "Choices",
    "value": "",
    "order": "10"
   }
  ],
  "208934372249576": [
   {
    "label": "Question",
    "value": "When would you like it tweeted?",
    "order": "5"
   },
   {
    "label": "Type",
    "value": "10",
    "order": "6"
   },
   {
    "label": "Default Value",
    "value": "",
    "order": "7"
   },
   {
    "label": "Table",
    "value": "",
    "order": "8"
   },
   {
    "label": "Reference Qualifer",
    "value": "",
    "order": "9"
   },
   {
    "label": "Choices",
    "value": "",
    "order": "10"
   }
  ],
  "208934375008859": [
   {
    "label": "Question",
    "value": "How much did you enjoy this item?",
    "order": "5"
   },
   {
    "label": "Type",
    "value": "5",
    "order": "6"
   },
   {
    "label": "Default Value",
    "value": "",
    "order": "7"
   },
   {
    "label": "Table",
    "value": "",
    "order": "8"
   },
   {
    "label": "Reference Qualifer",
    "value": "",
    "order": "9"
   },
   {
    "label": "Choices",
    "value": "Meh, It is okay, It is great, I am writing about it in my family tree, It is terrible, It is mediocre",
    "order": "10"
   }
  ]
 }
]

Item maker

Utility UI Actions and Context Menus;

Context Menus

Context ItemTableAvailabilityType
Add Data to TableglobalUser is Admin, Property is checkedList Header
Create a Module from this QueryglobalUser is Admin, Property is checkedList Header
GlideRecord Script - Background ScriptglobalUser is Admin, Property is checkedList Header
GlideRecord Script - PreviewglobalUser is Admin, Property is checkedList Header
Grab Grouped InformationglobalUser is Admin, Property is checkedList Header
Show JSONglobalUser is Admin, Property is checkedList Row
Show Schema MapglobalUser is Admin, Property is checkedList Header
Show Schema Map (Old)globalUser is Admin, Property is checkedList Header

UI Actions

UI ActionTableAvailabilityType
Add Multiple ‘Question Choices’item_option_newUser is Admin, type == “5”Form Link
Set Name from Questionitem_option_newUser is able to writeForm Link
GlideRecord Script - BackgroundtaskUser is Admin, Property is checkedForm Link
GlideRecord Script - PreviewtaskUser is Admin, Property is checkedForm Link
GlideRecord Script - XploretaskUser is Admin, Property is checkedForm Link
Replace Text*taskUser is Admin, Property is checkedForm Link
Show Contents of g_scratchpadtaskUser is Admin, Property is checkedForm Link
Show JSONtaskUser is Admin, Property is checkedForm Link
Show Schema MaptaskUser is Admin, Property is checkedForm Link
Show Schema Map (Old)taskUser is Admin, Property is checkedForm Link
Switch to List ViewtaskUser is Admin, Property is checkedForm Link
  • “Replace Text” requires a change on
    /sys_db_object_list.do?sysparm_query=nameINsys_journal_field%2Csys_audit%2Csys_history_set
    To allow for create, update, read and deletes.

Install

You only need to take two steps to install this.

  1. In Studio, import application from Github.
    https://github.com/jacebenson/devtoolbox.git

Using this requires setting the properties of the application. This application should be not noticable unless you “opt-in” on the properties.

The best way to see what properties exist is just to look in Studio at the System Properties.

People

Maintainer

Contributor