Custom data are additional pieces of information that you want to send in order to identify and debug issues specific to your product or application. You can send custom data when issues are created with Redpen.
There are two ways to send custom data:
- Static Data
- Dynamic Data
1. Static Data
Static data are the known metadata that is sent in every issue created. e.g. productId, tenantId, etc.
Add the customData JSON code inside the Redpen Widget script to send the static data as shown below:
After adding the customData in the widget script, the script will look as below:
2. Dynamic Data
Dynamic data are the metadata that is specific to the business logic of your application that you want to collect and send with every issue created. e.g. userId, application state, etc.
To collect dynamic data, you need to implement the getCustomData() method (the method must be on the same page where the Redpen widget script is added) in the application that has the business logic and returns a JSON string. Redpen widget will call the method when a user captures a screenshot or stops the screen recording to get the data.
After adding the getCustomData() method in the widget script, the script will look as below: