Skip to content

Instantly share code, notes, and snippets.

@waldothedeveloper
Created April 19, 2023 17:15
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Activity Properties: Run Script -> Decom Servers
var queryString = "task=" + current.sys_id;
var grTaskService = new GlideRecord("task_cmdb_ci_service");
grTaskService.addEncodedQuery(queryString);
var isValidQuery = grTaskService.isEncodedQueryValid(queryString);
var CIstoRetire = [];
if (isValidQuery) {
grTaskService.query();
while (grTaskService.next()) {
CIstoRetire.push(grTaskService.cmdb_ci_service.toString());
}
new Conviva_WorkflowUtils().StandardChangeServerRetirement(
CIstoRetire,
current.number
);
} else {
gs.addErrorMessage(
"The system has not been able to select the services to be retired. Please try again, or contact your ServiceNow support admin."
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment