Skip to content

Background Script to restart workflow and to update application owner #1591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
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
7 changes: 7 additions & 0 deletions Background Scripts/restart_workflow_from_background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var recordId = "ritm_sys_id";
var grRitm = new GlideRecord("sc_req_item");
grRitm.addQuery("sys_id", recordId);
grRitm.query();
if (grRitm.next()) {
new Workflow().restartWorkflow(grRitm);
}
10 changes: 10 additions & 0 deletions Scheduled Jobs/update_inactive_application_owner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var grApp = new GlideRecord("cmdb_ci_appl");
grApp.addEncodedQuery("owned_by.active=false");
grApp.query();
while(grApp.next()){
var managerSysId = grApp.owned_by.manager.toString(); // Get Manager SysId
if (managerSysId) {
grApp.owned_by = managerSysId;
grApp.update();
}
}
Loading