⚡️ Custom actions
We know that the built in actions (Bug reporting, Feature requests & Rating) might be not enough for certain use cases. For these situations we offer custom actions.

Configure a custom action

The first step with custom actions is to open the visual widget configurator and select "Custom action" as action type.
Now you need to set your custom action's name. This can be any name you'd like (it's important to check for the same name within the next step).

Custom action callback

Use the CustomAction in order to notice once a custom action gets triggered. If you use multiple custom actions, we suggest to check the triggered custom action's name in order to find out which custom action got triggered.
Import the BugBattle SDK and add the CustomAction and instantiate a CustomAction as shown below. Start by importing the CustomAction .
1
import bugbattle.io.bugbattle.model.CustomAction;
Copied!
Implement the CustomAction method. This method will be called, once a custom action get's triggered. Simply check for the customAction name to identify which custom action got triggered.
1
CustomAction.CustomActionCallback customActionCallback = new CustomAction.CustomActionCallback() {
2
@Override
3
public void invoke() {
4
System.log.println("The custom action MAGIC_ACTION got triggered.");
5
}
6
};
7
8
CustomAction customAction = new CustomAction("MAGIC_ACTION", customActionCallback);
Copied!
Last but not least, let Bugbattle know that you implemented the a CustomAction .
1
BugBattle.getInstance().registerCustomAction(customAction);
Copied!
The custom action name gets defined by you within the visual widget configurator.
Last modified 3mo ago