Capture event
Hi
How we capture the copy event or any ohter event ?
Hi
How we capture the copy event or any ohter event ?
You can use a combination of the getNameList() and getEventName() methods in the siEnvironmentBean to accomplish this. For example, here is a sample trigger script which will output the available beans for a given operation. Note that the trigger must be configured to fire on the certain event for this to work!
var eb = bsf.lookupBean("siEnvironmentBean");
function main ()
{
var list = eb.getNameList();
var event = eb.getEventName();
print ("*****************************************************");
print("The available beans for the " + event + " operation are: ");
print(list);
print ("*****************************************************");
}
function print(s)
{
Packages.mks.util.Logger.message("GENERAL", 1, s);
}
main();
As an example, here is what an item edit produces for output in the Integrity server.log:
2014-10-21 16:08:44,524 INFO [mksis.IntegrityServer] GENERAL(1): *****************************************************
2014-10-21 16:08:44,524 INFO [mksis.IntegrityServer] GENERAL(1): The available beans for the Issue.changed.pre operation are:
2014-10-21 16:08:44,524 INFO [mksis.IntegrityServer] GENERAL(1): [siEnvironmentBean, imIssueDeltaBean, imServerBean, parametersBean]
2014-10-21 16:08:44,525 INFO [mksis.IntegrityServer] GENERAL(1): *****************************************************
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.