Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
On UI Action Script, below parameters were passed in a GlideAjax call -
- Selected Risk Ids
- Current Issue Record

<img width="413" height="110" alt="image" src="https://github.com/user-attachments/assets/792d0c84-b249-4561-8db3-8ea9eb095426" />

Write a Script include that creates record on Issue to Item M2M table with the parameter values passed to it during GlideAjax call.
Original file line number Diff line number Diff line change
@@ -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<itemIds.length; i++){
var mapping = new GlideRecord('sn_grc_m2m_issue_item');
mapping.initialize();
mapping.sn_grc_issue = issueId;
mapping.sn_grc_item = itemIds[i];
mapping.insert();
}
result.count = itemIds.length;
return JSON.stringify(result);

},

type: 'issueAssociationinRL'
});
Loading