Highlighted
Absent Member.
Absent Member.
811 views

How to run a notification at set time every day?


I need to do something (a notification, I assume) every day at 5pm that will look at all records in a particular state, and whatever is in that state, push them along the transition to the next state.

I can't find a way to set up a time-of-day type notification. Anyone have a way?
0 Likes
6 Replies
Highlighted
Absent Member.
Absent Member.

Re: How to run a notification at set time every day?


Hard to kick off a notification without an event. The fact that items are in a state is not an event.

You could create a URL script to read through your items and transition the items that meet your criterea by changing their state values. Not very graceful but it will work. This might be a problem if you have to prepoulate a default field such as a User or User group ownership field.

Or, to make it gracefull you could have that url script change a field value that kicks off a notification that executes your transition in a normal way.

To get the URL script to run at 5pm kick off your URL script with the Windows Task Scheduler.

Another way I have automated a URL script is to create a notification with an escalation that repeats off every 24 hours. I have the escalation run my URL script. Not as exact as the Task scheduler should the system reboot...
0 Likes
Absent Member.
Absent Member.

Re: How to run a notification at set time every day?


We did something similar using an auxiliary table. We created a new aux table and created a notification rule that triggered whenever a new record was added to that table, and another that triggered when the record was deleted. Then created a notification with an escalation to repeat every 24 hours until the record was deleted. So when we add a new record to that table, it fires the notification (we send an email, but it could also run a script to find all the items that need to be transitioned in your case) and this repeats every 24 hours. Unfortunately, the notification seems to get lost every now and then so we need to do it manually, but that is the beauty of the URL context AppScript action.

Good luck!
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: How to run a notification at set time every day?


Probably going to have to use the Windows Task Scheduler idea to run the URL. I assume it's a batch file or something? I can't find in Task Scheduler where to just run a URL by itself.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: How to run a notification at set time every day?


Make something happen at a scheduled time.

That something needs to do something to items that will allow them to be transitioned.

Two ways I can think of to handle the first part. First method is a VBS script kicked off by a Windows scheduled task that runs an SBM AppScript in URL context. Simple example:

Set xmlHttpObj = CreateObject("Microsoft.XmlHttp")

str_Url = "http://***myserver***/tmtrack/tmtrack.dll? & _

"ScriptPage&scriptName=***Script Name***" & _

authstuff & paramstuff

xmlHttpObj.open "GET", str_Url , FALSE

xmlHttpObj.send ""

'WScript.Echo xmlHttpObj.responseText

nStatus = xmlHttpObj.Status

' Return status for the Scheduled Event log.

if nStatus=200 Then WScript.Quit 0 Else WScript.Quit 1

authstuff is either

"&ttAuthUID=***user name***&ttAuthPWD=***user password***"

or

"username:password" encoded with base64: "&ttAuthInfo=dXNlcm5hbWU6cGFzc3dvcmQ="

paramstuff is params to be passed to the SBM URL context AppScript.

Alternatively you could also use the Scheduled report feature of SBM to run a listing report that uses a template with a $SCRIPT() tag that will run an SBM AppScript. I was able to make this work when running the report manually but it didn't work properly when the Scheduled report ran .... I don't have a functional Notification server on my test VM.

Second part would be an AppScript. The script needs to find all items in the state you want and that meet any other criteria, then set a field (preferably BOOLEAN). The field will be detected by a Notification Rule which runs a Notification that fires a transition.


0 Likes
Highlighted
Absent Member.
Absent Member.

Re: How to run a notification at set time every day?


Looks like I have it set up with a vbscript file, here's the content of the vbscript file out on the system desktop.

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "iexplore http://(your_server_name)/tmtrack/tmt...", 9

WScript.Sleep 20000 ' Give ie some time to load

'This script kicks off the Script for SBM. It is executed from Task Manager.

The task manager Action is "Start a Program" c:\users\xxxx\Desktop\sbm_automated_job.vbs

The SBM URL script reads and aux table and sends out new items that require the users to do system checks. It reads the items to create from an Aux table. Only rough issue I have/had is that I use NTAuthentication, so, I had to start the Task as myself in the task manager so SBM thought it was me kicking off the URL Script.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: How to run a notification at set time every day?


Won't that launch a new instance of MSIE every time it runs?
For authentication, maybe create an API user. That way nobody can login as that user.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.