File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Server-Side Components/Script Includes/Created Records using Parameter Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ var issueAssociationinRL = Class . create ( ) ;
2+ issueAssociationinRL . prototype = Object . extendsObject ( global . AbstractAjaxProcessor , {
3+
4+ createRisk : function ( ) {
5+ var itemIds = this . getParameter ( 'sysparm_item_ids' ) ;
6+ var issueId = this . getParameter ( 'sysparm_issue_id' ) ;
7+ var result = { } ;
8+
9+ itemIds = itemIds . split ( ',' ) ;
10+ if ( itemIds . length == 1 && itemIds [ 0 ] == '' ) {
11+ result . error = gs . getMessage ( 'Missing Risk' ) ;
12+ }
13+
14+ for ( i = 0 ; i < itemIds . length ; i ++ ) {
15+ var mapping = new GlideRecord ( 'sn_grc_m2m_issue_item' ) ;
16+ mapping . initialize ( ) ;
17+ mapping . sn_grc_issue = issueId ;
18+ mapping . sn_grc_item = itemIds [ i ] ;
19+ mapping . insert ( ) ;
20+ }
21+ result . count = itemIds . length ;
22+ return JSON . stringify ( result ) ;
23+
24+ } ,
25+
26+ type : 'issueAssociationinRL'
27+ } ) ;
You can’t perform that action at this time.
0 commit comments