Service Manager / Service Center Practitioners Forum
cancel

Notification for KM Articles/documents !!

GJN13
Super Contributor.

Notification for KM Articles/documents !!

Hi Experts 

 

Good Day !!

 

i have below requirement in KM Module,

 

Notification mail to creator/author of the KM document, which should trigger before 2 weeks  expiry date of KM document.

 

Kindly help me with the script or any other  approach to accomplish this scenario.

 

Thanks,

Jagan

7 REPLIES
lisajo
Micro Focus Expert

Re: Notification for KM Articles/documents !!

Hi Jagan

Here is a discussion that might help

http://h30499.www3.hp.com/t5/HP-Service-Manager-Service/Notification-email-from-KM-Module-in-SM9-3/td-p/6085947#.U3tdkSgvB3s

 

Lisa

"HP Support
If you find that this post or any post resolves your issue, please make sure to mark it as an accepted solution."
lisajo
Micro Focus Expert

Re: Notification for KM Articles/documents !!

Hi Jagan

Here is another one

http://h30499.www3.hp.com/t5/HP-Service-Manager-Service/How-to-send-notification/td-p/6196255#.U3tejCgvB3s

 

Lisa

"HP Support
If you find that this post or any post resolves your issue, please make sure to mark it as an accepted solution."
GJN13
Super Contributor.

Re: Notification for KM Articles/documents !!

Hi Lisa,

 

Thanks for your reply, yes i have checked these links but i need to know the procedure how to acheive this,

 

i am not good at scripting , and i belive this can be done using javascript and we need to run the sceheduler which will check for the KM document before 2 weeks of expirration and will send a notification to the author of the document.

 

can any one help me on this how i can achieve this ,since this is very urgent for me.

 

Thanks in Advance,

 

jagan

GJN13
Super Contributor.

Re: Notification for KM Articles/documents !!

Hi All,

 

I have written the following script in Script library,its compiling but if i mannually execute the script nothing is happening,

 

no emails are triggering, kindly help me on this where i am doing mistake,

 

function KMexpirydocs()
{
var kmArticle = new SCFile("kmdocument");
var today=new Date();
var oT=kmArticle.expiration_date;
var Minutes=1000 * 3600 * 24;
do
{
var query=Math.ceil(oT.getTime()-today.getTime())/Minutes;
if(query > 1)
{
var rteReturnValue = new SCDatum();
var rteNames = new SCDatum();
var rteValues = new SCDatum();
var argNames = new SCDatum();
var argVals = new SCDatum();
var argVal=new SCDatum();

// Parameter names for RAD app us.notify

rteNames.push("name");
rteNames.push("record");
//Parameter values
rteValues.push("KMExpiryDocs");//Notification Name
rteValues.push("kmArticle");

system.functions.rtecall("callrad",
rteReturnValue,
"us.notify",
rteNames,
rteValues,
false); //run in same thread
}

else

print("No Expire Documents found")
}
while(kmArticle.getNext() == RC_SUCCESS)
}

 

Thanks,
JAgan

GJN13
Super Contributor.

Re: Notification for KM Articles/documents !!

Hi All,

 

The below script is executing but on the screen i can see notification message, and event out record is not getting generated,

 

Alos,this script selecting only one record and executing, if i have 5 KM docs that are being expire by 2 or 3 days, script work for first record only.

 

Please help me, how can i send the notification if i have more KM docs.

 

Escalation()
function Escalation()
{
var f= new SCFile( "kmdocument" );
f.doSelect( "author = \"falcon\"" );
var oT=f.expiration_date;
while(oT != null)
{
var today=new Date();
var Minutes=1000 * 3600 * 24;
var rteReturnValue = 1
if((Math.ceil((oT.getTime()-today.getTime()))/Minutes) > 0)
{
system.functions.rtecall("callrad", rteReturnValue, "us.notify",
["name", "record"], ["KMExpiryDocs",f], false);
oT=null;
}
else
print("No Expiry docs")
}
print("End Test")
}

ArpitAggarwal07
Honored Contributor.

Re: Notification for KM Articles/documents !!

try this

 

Escalation()
function Escalation()
{
 var f = new SCFile( "kmdocument" );
f.doSelect( "author = \"falcon\"" );
var oT=f.expiration_date;
var rc = f.doSelect(oT != null);
while(rc == RC_SUCCESS)
{print(oT);
var today=new Date();
var Minutes=1000 * 3600 * 24;
var rteReturnValue = 1
if((Math.ceil((oT.getTime()-today.getTime()))/Minutes) > 0)
{
system.functions.rtecall("callrad", rteReturnValue, "us.notify",
["name", "record"], ["KMExpire",f], false);
//oT=null;
}
else
print("No Expiry docs")
rc = f.getNext();
}
print("End Test")
}

Highlighted
ArpitAggarwal07
Honored Contributor.

Re: Notification for KM Articles/documents !!

{
 var f = new SCFile( "kmdocument" );
f.doSelect( "author = \"falcon\"" );
var oT=f.expiration_date;
var rc = f.doSelect(oT != null);
while(rc == RC_SUCCESS)
{print(oT);
var today=new Date();
var Minutes=1000 * 3600 * 24;
var rteReturnValue = 1
if(oT>system.functions.tod() && (Math.ceil((oT.getTime()-today.getTime()))/Minutes) > 0)
{
system.functions.rtecall("callrad", rteReturnValue, "us.notify",
["name", "record"], ["KMExpire",f], false);
//oT=null;
}
else
print("No Expiry docs")
rc = f.getNext();
}
print("End Test")
}