{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":966,"path":"api-reference/server-api-reference/c_CMDBGroupAPIScoped.md","title":"CMDBGroupAPI - Scoped","bundle":null,"doc_type":null,"release":"australia","body":"\n# CMDBGroupAPI- Scoped\n\nThe CMDBGroupAPI provides methods for performing actions on Configuration Management Database \\(CMDB\\) groups.\n\nThis API is a scoped static class. To use this class you must include the `sn_cmdbgroup` namespace identifier before the CMDBGroupAPI object. For example:\n\n```\nvar response = sn_cmdbgroup.CMDBGroupAPI.getManualCIList(groupSysId, false);\n```\n\nTo access this API you must have the itil or asset role.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## CMDBGroupAPI - getAllCI\\(String groupId, Boolean requireCompleteSet, Boolean requireAllQueryNodesCis\\)\n\nReturns all configuration items \\(CIs\\) for the specified group. The results include all manual CIs and the list of CIs from the query builder's saved query.\n\n<table id=\"table_nyt_5lz_kx\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ngroupId\n\n</td><td>\n\nString\n\n</td><td id=\"entry-groupId-CMDB\">\n\nSys\\_id of the Configuration Management Database \\(CMDB\\) group.\n\n</td></tr><tr><td>\n\nrequireCompleteSet\n\n</td><td>\n\nBoolean\n\n</td><td id=\"entry-requireCompleteSet-CMDB\">\n\nOptional, but must be passed if **requireAllQueryNodesCis** is passed. Flag that indicates whether an empty string is returned if any CIs are filtered out by access control list \\(ACL\\) restrictions.\n\n Valid values:\n\n-   true: Return empty string.\n-   false: Don't return value.\n\n Default: false\n\n</td></tr><tr><td>\n\nrequireAllQueryNodesCis\n\n</td><td>\n\nBoolean\n\n</td><td id=\"entry-requireAllQueryNodesCis-CMDB\">\n\nOptional. Flag that indicates whether to return CIs from all CMDB classes of the query. Valid values:\n\n-   true: Return CIs from all columns.\n-   false: Only return CIs from the starting node of the query builder query.\n\n Default: false\n\n</td></tr></tbody>\n</table><table id=\"table_rm2_322_vlb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerrors\n\n</td><td>\n\nList of errors for a failed operation.Data type: Array\n\n ```\n\"errors\": [ \n  {\n    \"message\": \"String\",\n    \"error\": \"String\"\n  } \n]\n```\n\n</td></tr><tr><td>\n\nerrors.error\n\n</td><td>\n\nError name.Possible values:\n\n-   GROUP\\_SYS\\_ID\\_IS\\_NOT\\_FOUND\n-   GROUP\\_SYS\\_ID\\_IS\\_EMPTY\n-   FAIL\\_TO\\_INSERT\\_GROUP\\_CI\\_PAIR\n-   FAIL\\_TO\\_INSERT\\_GROUP\\_QUERY\\_ID\\_PAIR\n-   CI\\_CAN\\_NOT\\_FOUND\n-   SAVED\\_QUERY\\_ID\\_NOT\\_FOUND\n-   ERROR\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY\n-   TIMEOUT\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY\n-   NOT\\_COMPLETE\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY\n-   MAX\\_LIMIT\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY\n-   GROUP\\_API\\_TIMEOUT\n-   EXCEPTION\\_FROM\\_EXECUTE\\_QUERY\n-   SOME\\_CI\\_NOT\\_VISIBLE\\_DUE\\_TO\\_SECURITY\\_CONSTRAINT\n\n Data type: String\n\n</td></tr><tr><td>\n\nerrors.message\n\n</td><td>\n\nBrief description of the error message.Data type: String\n\n</td></tr><tr><td>\n\nidList\n\n</td><td>\n\nList of CMDB CI sys\\_ids.Data type: Array\n\n</td></tr><tr><td>\n\npartialCIListDueToACLFlag\n\n</td><td>\n\nFlag that indicates if the list of returned CIs is incomplete due to ACL restrictions.**Note:** This is not considered an error condition, and no corresponding error information is returned.\n\n Data type: Boolean\n\n Valid values:\n\n-   true: **idList** is incomplete.\n-   false: **idList** is complete.\n\n</td></tr><tr><td>\n\nresult\n\n</td><td>\n\nFlag that indicates whether the method completed successfully.Possible values:\n\n-   true: Success\n-   false: Error\n\n</td></tr></tbody>\n</table>```\n// Script example: \nvar getAllCIFunc = function(groupSysId) {\n  var parser = new JSONParser();\n  var response = sn_cmdbgroup.CMDBGroupAPI.getAllCI(groupSysId, false);\n  var parsed = parser.parse(response);\n  if (parsed.result) {\n    gs.info(\"succeed to retrieve ci list: \" + parsed.idList);\n  } else {\n    gs.info(\"fail to retrieve list, errors: \" + JSON.stringify(parsed.errors));\n  }\n}\nvar groupExists = \"d0d2d25113152200eef2dd828144b0e4\";\nvar groupContainsInvalidSavedQuery = \"e685a2c3d7012200de92a5f75e610387\";\ngetAllCIFunc(groupExists);\ngetAllCIFunc(groupContainsInvalidSavedQuery);\n```\n\nOutput:\n\n```\n// Successful response\n{\n  'result':true, \n  'partialCIListDueToACLFlag': false,\n  'idList':[\n    '3a5dd3dbc0a8ce0100655f1ec66ed42c',\n    '6b43105c37301000deeabfc8bcbe5db2'\n  ] \n}\n\n// Error response\n{ \n  'result':false, \n  'errors':[ \n    {\n      'message':'Group does not exist',\n      'error':'GROUP_SYS_ID_IS_NOT_FOUND'\n    } \n  ], \n  'partialCIListDueToACLFlag':false,\n  'idList':[] \n}\n```\n\n## CMDBGroupAPI - getAllCIFromQueryBuilder\\(String groupId, Boolean requireCompleteSet, Boolean requireAllQueryNodesCis\\)\n\nReturns all configuration items \\(CIs\\) returned from all saved query builders' query IDs for the specified group.\n\n<table id=\"table_kcy_mjz_kx\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ngroupId\n\n</td><td>\n\nString\n\n</td><td id=\"entry-groupId-CMDB\">\n\nSys\\_id of the Configuration Management Database \\(CMDB\\) group.\n\n</td></tr><tr><td>\n\nrequireCompleteSet\n\n</td><td>\n\nBoolean\n\n</td><td id=\"entry-requireCompleteSet-CMDB\">\n\nOptional, but must be passed if **requireAllQueryNodesCis** is passed. Flag that indicates whether an empty string is returned if any CIs are filtered out by access control list \\(ACL\\) restrictions.\n\n Valid values:\n\n-   true: Return empty string.\n-   false: Don't return value.\n\n Default: false\n\n</td></tr><tr><td>\n\nrequireAllQueryNodesCis\n\n</td><td>\n\nBoolean\n\n</td><td id=\"entry-requireAllQueryNodesCis-CMDB\">\n\nOptional. Flag that indicates whether to return CIs from all CMDB classes of the query. Valid values:\n\n-   true: Return CIs from all columns.\n-   false: Only return CIs from the starting node of the query builder query.\n\n Default: false\n\n</td></tr></tbody>\n</table><table id=\"table_lfb_k22_vlb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nerrors\n\n</td><td>\n\nList of errors for a failed operation.Data type: Array\n\n ```\n\"errors\": [ \n  {\n    \"message\": \"String\",\n    \"error\": \"String\"\n  } \n]\n```\n\n</td></tr><tr><td>\n\nerrors.error\n\n</td><td>\n\nError name.Possible values:\n\n-   GROUP\\_SYS\\_ID\\_IS\\_NOT\\_FOUND\n-   GROUP\\_SYS\\_ID\\_IS\\_EMPTY\n-   FAIL\\_TO\\_INSERT\\_GROUP\\_CI\\_PAIR\n-   FAIL\\_TO\\_INSERT\\_GROUP\\_QUERY\\_ID\\_PAIR\n-   CI\\_CAN\\_NOT\\_FOUND\n-   SAVED\\_QUERY\\_ID\\_NOT\\_FOUND\n-   ERROR\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY\n-   TIMEOUT\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY\n-   NOT\\_COMPLETE\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY\n-   MAX\\_LIMIT\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY\n-   GROUP\\_API\\_TIMEOUT\n-   EXCEPTION\\_FROM\\_EXECUTE\\_QUERY\n-   SOME\\_CI\\_NOT\\_VISIBLE\\_DUE\\_TO\\_SECURITY\\_CONSTRAINT\n\n Data type: String\n\n</td></tr><tr><td>\n\nerrors.message\n\n</td><td>\n\nBrief description of the error message.Data type: String\n\n</td></tr><tr><td>\n\nidList\n\n</td><td>\n\nList of CMDB CI sys\\_ids.Data type: Array\n\n</td></tr><tr><td>\n\npartialCIListDueToACLFlag\n\n</td><td>\n\nFlag that indicates if the list of returned CIs is incomplete due to ACL restrictions.**Note:** This is not considered an error condition, and no corresponding error information is returned.\n\n Data type: Boolean\n\n Valid values:\n\n-   true: **idList** is incomplete.\n-   false: **idList** is complete.\n\n</td></tr><tr><td>\n\nresult\n\n</td><td>\n\nFlag that indicates whether the method completed successfully.Possible values:\n\n-   true: Success\n-   false: Error\n\n</td></tr></tbody>\n</table>```\n// Script example:\nvar getAllCIFromQueryBuilderFunc = function(groupSysId) {\n  var parser = new JSONParser();\n  var response = sn_cmdbgroup.CMDBGroupAPI.getAllCIFromQueryBuilder(groupSysId, false);\n  var parsed = parser.parse(response);\n  if (parsed.result) {\n    gs.info(\"succeed to retrieve ci list: \" + parsed.idList);\n  } else {\n    gs.info(\"fail to retrieve list, errors: \" + JSON.stringify(parsed.errors));\n  }\n}\nvar groupExists = \"d0d2d25113152200eef2dd828144b0e4\";\nvar groupContainsInvalidSavedQuery = \"e685a2c3d7012200de92a5f75e610387\";\ngetAllCIFromQueryBuilderFunc(groupExists);\ngetAllCIFromQueryBuilderFunc(groupContainsInvalidSavedQuery);\n```\n\nOutput:\n\n```\n// Successful response\n{\n  'result':true, \n  'partialCIListDueToACLFlag': false,\n  'idList':[\n    '3a5dd3dbc0a8ce0100655f1ec66ed42c',\n    '6b43105c37301000deeabfc8bcbe5db2'\n  ] \n}\n\n// Error response\n{ \n  'result':false, \n  'errors':[ \n    {'message':'Group does not exist',\n    'error':'GROUP_SYS_ID_IS_NOT_FOUND'} \n  ], \n  'partialCIListDueToACLFlag':false,\n  'idList':[] \n}\n```\n\n## CMDBGroupAPI - getManualCIList\\(String groupId, Boolean requireCompleteSet\\)\n\nReturns the CMDB group's manual CI list.\n\n|Name|Type|Description|\n|----|----|-----------|\n|groupId|String|The sysId of the CMDB group.|\n|requireCompleteSet|Boolean|When true, returns an error string if any CIs are filtered out by ACL restrictions.|\n\n<table id=\"table_ffx_szx_kx\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nString\n\n</td><td>\n\nA JSON formated string in the format ```\n{ 'result':false, \n'errors':[ {'message':'Group does not exist',\n            'error':'GROUP_SYS_ID_IS_NOT_FOUND'},\n { } // another error if it exists \n ], \n'partialCIListDueToACLFlag':false,\n'idList':['sys_id_1', 'sys_id2'] }\n```\n\nWhere -   result - a boolean flag. When true the method was successful.\n-   errors - a list of errors with a message and error code.\n-   partialCIListDueToACLFlag -  a Boolean flag. When true, the idList is incomplete due to an ACL restriction. When false, the idList is complete.\n-   idList - an array of cmdb\\_ci sys\\_ids\n\n When not successful, returns one of the errors GROUP\\_SYS\\_ID\\_IS\\_NOT\\_FOUND, GROUP\\_SYS\\_ID\\_IS\\_EMPTY, FAIL\\_TO\\_INSERT\\_GROUP\\_CI\\_PAIR, FAIL\\_TO\\_INSERT\\_GROUP\\_QUERY\\_ID\\_PAIR, CI\\_CAN\\_NOT\\_FOUND, SAVED\\_QUERY\\_ID\\_NOT\\_FOUND, ERROR\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, TIMEOUT\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, NOT\\_COMPLETE\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, MAX\\_LIMIT\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, GROUP\\_API\\_TIMEOUT, EXCEPTION\\_FROM\\_EXECUTE\\_QUERY, SOME\\_CI\\_NOT\\_VISIBLE\\_DUE\\_TO\\_SECURITY\\_CONSTRAINT\n\n</td></tr></tbody>\n</table>```\n// Script example for requireCompleteSet being false:\n    var getManualCIList = function(groupSysId) {\n    var parser = new JSONParser();\n    var response = sn_cmdbgroup.CMDBGroupAPI.getManualCIList(groupSysId, false);\n    var parsed = parser.parse(response);\n    if (parsed.result) {\n        gs.info(\"succeed to retrieve ci list: \" + parsed.idList);\n    } else {\n        gs.info(\"fail to retrieve list, errors: \" + JSON.stringify(parsed.errors));\n    }\n}\n// create a group in cmdb_group, and add CIs to this group in Edit Manual CI form\nvar groupExists = \"d0d2d25113152200eef2dd828144b0e4\";\n// use a non-exist group\nvar groupDoesNotExists = \"d0d2d25113152200eef2dd828144b0e4111\";\ngetManualCIList(groupExists);\ngetManualCIList(groupDoesNotExists);\n \n```\n\nOutput: \\(Line breaks added for formatting.\\)\n\n```\nsucceed to retrieve ci \nlist: 6b43105c37301000deeabfc8bcbe5db2,2dfd7c8437201000deeabfc8bcbe5d56\nfail to retrieve list, errors: \n[{\"message\":\"Group does not exist\",\"error\":\"GROUP_SYS_ID_IS_NOT_FOUND\"}]\n```\n\n```\n// Script example for requireCompleteSet being true\n    var getManualCIList = function(groupSysId) {\n    var parser = new JSONParser();\n    var response = sn_cmdbgroup.CMDBGroupAPI.getManualCIList(groupSysId, true);\n    var parsed = parser.parse(response);\n    if (parsed.result) {\n        gs.info(\"succeed to retrieve ci list: \" + parsed.idList);\n    } else {\n        gs.info(\"fail to retrieve list, errors: \" + JSON.stringify(parsed.errors));\n    }\n}\n// create a group in cmdb_group, and add CIs to this group in Edit Manual CI form\nvar groupExists = \"d0d2d25113152200eef2dd828144b0e4\";\ngetManualCIList(groupExists);\n```\n\nOutput: \\(Line breaks added for formatting.\\)\n\n```\nfail to retrieve list, errors: \n[{\"message\":\"Some CI(s) not visible due to security constraint\",\n\"error\":\"SOME_CI_NOT_VISIBLE_DUE_TO_SECURITY_CONSTRAINT\"}]\n```\n\n## CMDBGroupAPI - getSavedQueryIdList\\(String groupId, Boolean requireCompleteSet\\)\n\nReturns the query builder's query IDs for the specified CMDB group.\n\n|Name|Type|Description|\n|----|----|-----------|\n|groupId|String|The sysId of the CMDB group.|\n|requireCompleteSet|Boolean|When true, returns an empty string if any CIs are filtered out by ACL restrictions.|\n\n<table id=\"table_fwk_lfy_kx\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nString\n\n</td><td>\n\nA JSON formated string in the format ```\n{ 'result':false, \n'errors':[ {'message':'Group does not exist',\n            'error':'GROUP_SYS_ID_IS_NOT_FOUND'},\n { } // another error if it exists \n ], \n'partialCIListDueToACLFlag':false,\n'idList':['sys_id_1', 'sys_id2'] }\n```\n\nWhere -   result - a boolean flag. When true the method was successful.\n-   errors - a list of errors with a message and error code.\n-   partialCIListDueToACLFlag -  a Boolean flag. When true, the idList is incomplete due to an ACL restriction. When false, the idList is complete.\n-   idList - an array of cmdb\\_ci sys\\_ids\n\n When not successful, returns one of the errors GROUP\\_SYS\\_ID\\_IS\\_NOT\\_FOUND, GROUP\\_SYS\\_ID\\_IS\\_EMPTY, FAIL\\_TO\\_INSERT\\_GROUP\\_CI\\_PAIR, FAIL\\_TO\\_INSERT\\_GROUP\\_QUERY\\_ID\\_PAIR, CI\\_CAN\\_NOT\\_FOUND, SAVED\\_QUERY\\_ID\\_NOT\\_FOUND, ERROR\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, TIMEOUT\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, NOT\\_COMPLETE\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, MAX\\_LIMIT\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, GROUP\\_API\\_TIMEOUT, EXCEPTION\\_FROM\\_EXECUTE\\_QUERY, SOME\\_CI\\_NOT\\_VISIBLE\\_DUE\\_TO\\_SECURITY\\_CONSTRAINT\n\n</td></tr></tbody>\n</table>```\n// Script example:\nvar getSavedQueryIdList = function(groupSysId) {\n    var parser = new JSONParser();\n    var response = sn_cmdbgroup.CMDBGroupAPI.getSavedQueryIdList(groupSysId, false);\n    var parsed = parser.parse(response);\n    if (parsed.result) {\n        gs.info(\"succeed to retrieve saved query id list: \" + parsed.idList);\n    } else {\n        gs.info(\"fail to retrieve list, errors: \" + JSON.stringify(parsed.errors));\n    }\n}\nvar groupExists = \"d0d2d25113152200eef2dd828144b0e4\";\nvar groupDoesNotExists = \"d0d2d25113152200eef2dd828144b0e4111\";\ngetSavedQueryIdList(groupExists);\ngetSavedQueryIdList(groupDoesNotExists);\n```\n\nOutput: \\(Line breaks added for formatting.\\)\n\n```\nsucceed to retrieve saved query id list: 5d498532d7c12200de92a5f75e6103ce\nfail to retrieve list, errors:\n [{\"message\":\"Group does not exist\",\"error\":\"GROUP_SYS_ID_IS_NOT_FOUND\"}]\n```\n\n## CMDBGroupAPI - setManualCIList\\(String groupId, String ciSysIds\\)\n\nSets the manual CI list for the specified group. The existing manual CI list is overwritten. CI sysIds not found in the cmdb\\_ci table are ignored.\n\n|Name|Type|Description|\n|----|----|-----------|\n|groupId|String|The sysId of the CMDB group.|\n|ciSysIds|String|Comma separated list of CI sysIds.|\n\n<table id=\"table_a53_cnz_kx\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nString\n\n</td><td id=\"CMDBGroupAPI_JSON_output\">\n\nA JSON formated string in the format ```\n{ 'result':false, \n'errors':[ {'message':'Group does not exist',\n            'error':'GROUP_SYS_ID_IS_NOT_FOUND'},\n { } // another error if it exists \n ], \n'partialCIListDueToACLFlag':false,\n'idList':['sys_id_1', 'sys_id2'] }\n```\n\nWhere -   result - a boolean flag. When true the method was successful.\n-   errors - a list of errors with a message and error code.\n-   partialCIListDueToACLFlag -  a Boolean flag. When true, the idList is incomplete due to an ACL restriction. When false, the idList is complete.\n-   idList - an array of cmdb\\_ci sys\\_ids\n\n When not successful, returns one of the errors GROUP\\_SYS\\_ID\\_IS\\_NOT\\_FOUND, GROUP\\_SYS\\_ID\\_IS\\_EMPTY, FAIL\\_TO\\_INSERT\\_GROUP\\_CI\\_PAIR, FAIL\\_TO\\_INSERT\\_GROUP\\_QUERY\\_ID\\_PAIR, CI\\_CAN\\_NOT\\_FOUND, SAVED\\_QUERY\\_ID\\_NOT\\_FOUND, ERROR\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, TIMEOUT\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, NOT\\_COMPLETE\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, MAX\\_LIMIT\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, GROUP\\_API\\_TIMEOUT, EXCEPTION\\_FROM\\_EXECUTE\\_QUERY, SOME\\_CI\\_NOT\\_VISIBLE\\_DUE\\_TO\\_SECURITY\\_CONSTRAINT\n\n</td></tr></tbody>\n</table>```\n// Script example:\nvar setManualCIListFunc = function(groupSysId, manualCIList) {\n    var parser = new JSONParser();\n    var response = sn_cmdbgroup.CMDBGroupAPI.setManualCIList(groupSysId, manualCIList);\n    var parsed = parser.parse(response);\n    if (parsed.result) {\n        gs.info(\"succeed to set manual ci list\");\n    } else {\n        gs.info(\"fail to set manual ci list, errors: \" + JSON.stringify(parsed.errors));\n    }\n}\nvar group = \"d0d2d25113152200eef2dd828144b0e4\";\nvar groupDoesNotExist = \"1234\";\nvar manualCIList = \"b4fd7c8437201000deeabfc8bcbe5dc1, affd3c8437201000deeabfc8bcbe5dc3\";\nsetManualCIListFunc(group, manualCIList);\nsetManualCIListFunc(groupDoesNotExist, manualCIList);\n```\n\nOutput: \\(Line breaks added for formatting.\\)\n\n```\nsucceed to set manual ci list\nfail to set manual ci list, errors: [{\"message\":\"Group does not exist\",\"error\":\n\"GROUP_SYS_ID_IS_NOT_FOUND\"}]\n```\n\n## CMDBGroupAPI - setSavedQueryIdList\\(String groupId, String queryIds\\)\n\nSets the saved query ID list for the specified group. The existing query ID list is overwritten. Query sysIds not found in the qb\\_saved\\_query table are ignored.\n\n|Name|Type|Description|\n|----|----|-----------|\n|groupId|String|The sysId of the CMDB group.|\n|queryIds|String|Comma separated list of saved query sysIds.|\n\n<table id=\"table_i3d_1qz_kx\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nString\n\n</td><td>\n\nA JSON formated string in the format ```\n{ 'result':false, \n'errors':[ {'message':'Group does not exist',\n            'error':'GROUP_SYS_ID_IS_NOT_FOUND'},\n { } // another error if it exists \n ], \n'partialCIListDueToACLFlag':false,\n'idList':['sys_id_1', 'sys_id2'] }\n```\n\nWhere -   result - a boolean flag. When true the method was successful.\n-   errors - a list of errors with a message and error code.\n-   partialCIListDueToACLFlag -  a Boolean flag. When true, the idList is incomplete due to an ACL restriction. When false, the idList is complete.\n-   idList - an array of cmdb\\_ci sys\\_ids\n\n When not successful, returns one of the errors GROUP\\_SYS\\_ID\\_IS\\_NOT\\_FOUND, GROUP\\_SYS\\_ID\\_IS\\_EMPTY, FAIL\\_TO\\_INSERT\\_GROUP\\_CI\\_PAIR, FAIL\\_TO\\_INSERT\\_GROUP\\_QUERY\\_ID\\_PAIR, CI\\_CAN\\_NOT\\_FOUND, SAVED\\_QUERY\\_ID\\_NOT\\_FOUND, ERROR\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, TIMEOUT\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, NOT\\_COMPLETE\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, MAX\\_LIMIT\\_DURING\\_QUERY\\_BUILDER\\_PROCESS\\_QUERY, GROUP\\_API\\_TIMEOUT, EXCEPTION\\_FROM\\_EXECUTE\\_QUERY, SOME\\_CI\\_NOT\\_VISIBLE\\_DUE\\_TO\\_SECURITY\\_CONSTRAINT\n\n</td></tr></tbody>\n</table>```\n// Script example:\nvar setSavedQueryIdListFunc = function(groupSysId, queryIdList) {\n    var parser = new JSONParser();\n    var response = sn_cmdbgroup.CMDBGroupAPI.setSavedQueryIdList(groupSysId, queryIdList);\n    var parsed = parser.parse(response);\n    if (parsed.result) {\n        gs.info(\"succeed to set saved query id list\");\n    } else {\n        gs.info(\"fail to set saved query id list, errors: \" + JSON.stringify(parsed.errors));\n    }\n}\nvar group = \"d0d2d25113152200eef2dd828144b0e4\";\nvar savedQueryBuilderIdList = \"394585fed7812200de92a5f75e6103e8\";\nvar savedQueryBuilderIdNotExistList = \"b4fd7c8437201000deeabfc8bcbe5dc1,\n   affd3c8437201000deeabfc8bcbe5dc3\";\n \nsetSavedQueryIdListFunc(group, savedQueryBuilderIdList);\nsetSavedQueryIdListFunc(group, savedQueryBuilderIdNotExistList);\n\n```\n\nOutput: \\(Line breaks added for formatting.\\)\n\n```\nsucceed to set saved query id list\nfail to set saved query id list, errors: [{\"message\":\n\"Saved query id(b4fd7c8437201000deeabfc8bcbe5dc1) is not found for \ngroup(d0d2d25113152200eef2dd828144b0e4)\",\"error\":\n\"SAVED_QUERY_ID_NOT_FOUND\"},{\"message\":\n\"Saved query id(affd3c8437201000deeabfc8bcbe5dc3) is not found for \ngroup(d0d2d25113152200eef2dd828144b0e4)\",\"error\":\"SAVED_QUERY_ID_NOT_FOUND\"}]\n```\n\n"}}