diff --git a/Server-Side Components/Script Includes/Created Records using Parameter/README.md b/Server-Side Components/Script Includes/Created Records using Parameter/README.md new file mode 100644 index 0000000000..9e0e75ec91 --- /dev/null +++ b/Server-Side Components/Script Includes/Created Records using Parameter/README.md @@ -0,0 +1,7 @@ +On UI Action Script, below parameters were passed in a GlideAjax call - +- Selected Risk Ids +- Current Issue Record + +image + +Write a Script include that creates record on Issue to Item M2M table with the parameter values passed to it during GlideAjax call. diff --git a/Server-Side Components/Script Includes/Created Records using Parameter/siForCreateRecords.js b/Server-Side Components/Script Includes/Created Records using Parameter/siForCreateRecords.js new file mode 100644 index 0000000000..bd1e014f25 --- /dev/null +++ b/Server-Side Components/Script Includes/Created Records using Parameter/siForCreateRecords.js @@ -0,0 +1,27 @@ +var issueAssociationinRL = Class.create(); +issueAssociationinRL.prototype = Object.extendsObject(global.AbstractAjaxProcessor, { + + createRisk: function(){ + var itemIds = this.getParameter('sysparm_item_ids'); + var issueId = this.getParameter('sysparm_issue_id'); + var result={}; + + itemIds = itemIds.split(','); + if (itemIds.length == 1 && itemIds[0] == ''){ + result.error = gs.getMessage('Missing Risk'); + } + + for(i=0; i