Skip to content

Commit 1eb1bd5

Browse files
authored
Merge branch 'ServiceNowDevProgram:main' into main
2 parents 98771cd + da81c7f commit 1eb1bd5

File tree

8 files changed

+47
-0
lines changed

8 files changed

+47
-0
lines changed

Browser Bookmarklets/Create new update set/create_update_set.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Create udpate set
2+
3+
When viewing a record in the rm_story table, this bookmarklet will create a update set in a DIFFERENT instance and enable you to pre-populate values. The example below will create an update set in the ficticious "MYDEV" instance and set the Name (`STRY1234 - Short Description`) and Description fields based on values taken from the story record. To use this bookmarklet, udpate the instance name and query string as needed.
4+
5+
```js
6+
javascript:
7+
var w=window.frames["gsft_main"]!==undefined?window.frames["gsft_main"]:window;
8+
var q="name="+w.g_form.getValue("number")+" - "+w.g_form.getValue("short_description")+
9+
"^description=Description: @"+w.g_form.getValue("description");
10+
top.open("https://MYDEV.service-now.com/sys_update_set.do?sys_id=-1&sysparm_query="+q);
11+
12+
```

Browser Bookmarklets/Create story task/create_story_task.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Create a new story task
2+
3+
When viewing a record in the rm_story table, this bookmarklet will create a new child task and enable you to pre-populate values. The example below will create a task of type `Testing` and set the short description to `Test STRY12345 - Short Description` where the story number and short description values are taken from the story record.
4+
5+
```js
6+
javascript:
7+
var w=window.frames["gsft_main"]!==undefined?window.frames["gsft_main"]:window;
8+
var q="parent="+w.g_form.getUniqueValue()+
9+
"^type=4"+
10+
"^short_description=Test "+w.g_form.getValue("number")+" - "+w.g_form.getValue("short_description")+
11+
"^EQ";
12+
top.open("rm_scrum_task.do?sys_id=-1&sysparm_query="+q);
13+
```

Browser Bookmarklets/Impersonation/impersonation.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# User Impersonation
2+
When a user impersonates another user, the page is redirected to the home page for the new user. This bookmarklet will open the impersonation page in a popup window so the user impersonation can be completed without redirecting the paging being viewed. After selecting the new user, the popup will close and the instance page will refresh with the new user context.
3+
4+
This was updated from a new tab to the popup based on the "Quick Login to current instance" bookmarklet by OrgovanGeza.
5+
6+
```js
7+
javascript:let impWin=window.open("/impersonate_dialog.do", "Impersonation", "scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=300,height=300,left=100,top=100");setInterval(()=>{if(!impWin.location.pathname.includes("impersonate")){impWin.close();window.location.reload();};},500);
8+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Get today's deactivated users records script Scheduled Jobs
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
Get today's deactivated users records
3+
*/
4+
var grUserRecords = JSON.parse(new global.glide_record_functions().getTableRecords('sys_user', 'sys_updated_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^active=false^u_disabled_due_to_inactivity=false', 'sys_id'));
5+
if (grUserRecords.length > 0) {
6+
//Take action on individual record
7+
for (var i = 0; i < grUserRecords.length; i++) {
8+
gs.eventQueue('actions.post.user.account.disabled', current, grUserRecords[i].sys_id);
9+
}
10+
}

0 commit comments

Comments
 (0)