Application Release Form Actions

Form actions control the display, manipulation, and submission of the final REST Grid on the form. These actions are:

  • Form Load: Enable <tool> Dev Tasks
  • <toolname> Add
  • <toolname> Remove
  • On Submit: Handle Relationship Services

The form actions execute JavaScript to load the final REST Grid, add and remove items to and from the REST Grid, and process the results to the Relationship Service upon submit.

The Form Load: Enable <toolname> Dev Tasks action executes the function enableRelationshipServices("<gridname>"); upon form load. This function initiates the load of the REST Grid after setting up to intercept the result processing in order to save the service's results. The gridname is the name of the REST Grid on its General properties pane.

The <toolname> Add action executes the following JavaScript when the Add link is clicked:

// Column IDs come from the REST Grid Widget displaying the external tool's items 
       to relate to the App Release. 
// The Column IDs map to Item ID, Title, Description, Submitter, Submit Date, Record ID, 
       and URL and must be in this order
// If a tool does not have one of these, use double quotes for the column name ("")
var columnIds = ["records.number", "records.short_description", 
                    "records.description", "records.sys_created_by",
                    "records.sys_created_on", "records.sys_id", ""];
// Add the selected CRs to an App Release.                   
// Parameters include:
// source grid control name - for the list of items to relate to this App Release                 
// target grid control name - displaying the items related to this App Release                
// external tool name - no spaces allowed (replace with underscores or remove)
// external tool object type - no spaces allowed (replace with underscores or remove)
// column ID array created above           
addDevTasks("SNOWCRGrid", "SNOWDevTasksGrid", "ServiceNow", "Change_Request", columnIds); 

The preceding code contains the details of the ServiceNow Add action's JavaScript. When adding new tools, change the columnIds and the arguments of the addDevTasks function to reflect the new names of the REST Grids, tool, and tool object. The addDevTasks function adds selected items in the tool's item REST Grid into the results from the original currently selected list REST Grid.

The <toolname> Remove action invokes the removeDevTasks("<gridname>"); function when the Remove link is clicked. This function removes the selected items in the currently selected REST Grid. It does not move them to the tool's list of items that may be associated to the application release.

The On Submit: Handle Relationship Services action invokes the handleRelationshipServicesSubmit(); function to create the external tool nodes and relate them to the application release, and remove the relationship between previous external tool nodes and the application release. The external tool nodes are not removed due to the need for extra processing to make sure no other application release is related to the node.