Skip to main content
1-Visitor
September 22, 2014
Solved

Capture event

  • September 22, 2014
  • 2 replies
  • 1232 views

Hi

How we capture the copy event or any ohter event ?

    Best answer by JoeBartlett

    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): *****************************************************

    2 replies

    16-Pearl
    September 26, 2014

    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

    21-Topaz I
    October 21, 2014

    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): *****************************************************