diff --git a/Background Scripts/Get Duplicate/readme.md b/Background Scripts/Get Duplicate/readme.md new file mode 100644 index 0000000000..23de281b78 --- /dev/null +++ b/Background Scripts/Get Duplicate/readme.md @@ -0,0 +1,3 @@ +Using GlideAggregate function to find out tickets (tasks) with same number. OOB there happens to be a Unique checkbox at dictionary level +and if in case not set to True it might create duplicate numbered tickets. +Script will help find, ticekts if any. diff --git a/Background Scripts/Get Duplicate/script.js b/Background Scripts/Get Duplicate/script.js new file mode 100644 index 0000000000..4ebdc39422 --- /dev/null +++ b/Background Scripts/Get Duplicate/script.js @@ -0,0 +1,8 @@ +var dpchk = new GlideAggregate('task'); +dpchk.groupBy('number'); +dpchk.addHaving('COUNT', '>', 1); +dpchk.query(); +while(dpchk.next()) +{ + gs.print(dpchk.number); +} diff --git a/Background Scripts/Revert Workflow Version/readme.md b/Background Scripts/Revert Workflow Version/readme.md new file mode 100644 index 0000000000..a535acc1b0 --- /dev/null +++ b/Background Scripts/Revert Workflow Version/readme.md @@ -0,0 +1,4 @@ +How often you come across cases where any version update to workflow breaks some other element of the existing workflow in PRD. Consider a case where more than one developer works on workflow and the updates are not in sync. When pushed to PRD breaks the workflow and as the issue is in PRD all you need to do is a break-fix at the soonest. +The idea is to return to a stable, known version of the workflow to ensure continuity and productivity, while investigating or fixing the problems in the newer version and thus reverting to previous working version of workflow is the only resort. + +Use this as a background script/fix script and execute by merely changing the sys_id of workflows from 'wf_workflow_version' table. diff --git a/Background Scripts/Revert Workflow Version/script.js b/Background Scripts/Revert Workflow Version/script.js new file mode 100644 index 0000000000..7879dcfd55 --- /dev/null +++ b/Background Scripts/Revert Workflow Version/script.js @@ -0,0 +1,15 @@ +var updatevftoprevious = new GlideRecord('wf_workflow_version'); + +if (updatevftoprevious.get('4f215adf1b533d54bc97dce0b24bcb31')) //pass sys_id of current workflow version here +{ + updatevftoprevious.published = false; //sets the published status to false + updatevftoprevious.update(); +} + + +var updatevftopreviousvf2 = new GlideRecord('wf_workflow_version'); +if (updatevftopreviousvf2.get('2cb9a6418713b5140b0f0d490cbb3512')) //pass sys_id of workflow version that needs to be reverted to +{ + updatevftopreviousvf2.published = true;//sets the published status to false + updatevftopreviousvf2.update(); +}