How to add custom data?

1

Custom Data

Add CustomData that will be attached to the Issue.

You can provide a static object of information.

Static Object
customData : {  
     version: 1.0,  
     productId: 55c-x4e-855,  
     ...
}
Widget Script with Static Object
<script type="text/javascript" id="redpen_embedded_app_script1">  
window.embeddedRedpenConfig = {            
       userServiceConnectionId: '4662ac64-f9c3-11eb-9a03-0242ac130003',            
      projectKey: 'P1',            
      customData : {                
            version: 1.0,                
            productId: 55c-x4e-855,              
             ...            
      }        
}
</script>
<script src="https://api.redpen.ai/redpenScript.js"></script>

OR

You can provide a function that returns a dynamic object(information).

Provided function calls when the user clicks on the widget

customData : getInformation

function getInformation(){  
/*  
logic  
*/  

// return dynamic data  
return {      
      logedinUserId: "1e9-w1c-875",    
      email: "xyz@abc.com",    
      ...  
      }
}
Widget Script with Function
<script type="text/javascript" id="redpen_embedded_app_customData">  
function getInformation(){    
/*    
logic    
*/        

// return dynamic data    
return {        
      logedinUserId: "1e9-w1c-875",      
      email: "xyz@abc.com",    
       ...    
      }  
}
</script>
<script type="text/javascript" id="redpen_embedded_app_script1">  
window.embeddedRedpenConfig = {            
      userServiceConnectionId: '4662ac64-f9c3-11eb-9a03-0242ac130003',            
      projectKey: 'P1',            
      customData: getInformation,          
}  
</script>
<script src="https://api.redpen.ai/redpenScript.js"></script>