Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
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): *****************************************************
Hello A A,
What, exactly do you mean? Are you looking to launch a trigger event, or are you just trying to log events that are occuring?
Regards,
Kael
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): *****************************************************