SSP Studio Tips: Difference between revisions

From SMTX Wiki
Jump to navigation Jump to search
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:




=== Get a translation and add default value if missing (7.24.07) ===  
=== Redirect app ===
#first parameter: Category
 
#second parameter: Label
The code below can be used to get the full URL within SSP using only the SSP ticket.
#third parameter: Default Value
 
StudioInterface.translate('Common', 'Profile', 'My Profile');
var sspRoot = StudioInterface.getSspRoot();
''return'': the translation value for the SSP translations and if it doesn't exits yet, it will be added with the default value in the default language
const redirectTemplate = sspRoot + "Workflow/ProcessInstanceDetail.aspx?processInstanceId={id}&processInstanceGuid={guid}&forceoverview=1";
var ticketToRedirect = StudioInterface.getQueryStringValue("ticketid");
try {
    var ticketDetails = JSON.parse(WorkflowInterface.getWorkflowInformation(+ticketToRedirect));
    if (ticketDetails && ticketDetails.guid) {
        var redirectUrl = redirectTemplate.replace('{id}', ticketToRedirect);
        redirectUrl = redirectUrl.replace('{guid}', ticketDetails.guid);
        return { action: "redirect", content: redirectUrl }
    }
}
catch (e) {
return JSON.stringify(e)
}
return "Not able to redirect to ticket " + ticketToRedirect;

Latest revision as of 16:56, 21 May 2026

Avoid the white screen Get delegates for actor


Redirect app

The code below can be used to get the full URL within SSP using only the SSP ticket.

var sspRoot = StudioInterface.getSspRoot();
const redirectTemplate = sspRoot + "Workflow/ProcessInstanceDetail.aspx?processInstanceId={id}&processInstanceGuid={guid}&forceoverview=1";
var ticketToRedirect = StudioInterface.getQueryStringValue("ticketid");
try {
   var ticketDetails = JSON.parse(WorkflowInterface.getWorkflowInformation(+ticketToRedirect));
   if (ticketDetails && ticketDetails.guid) {
       var redirectUrl = redirectTemplate.replace('{id}', ticketToRedirect);
       redirectUrl = redirectUrl.replace('{guid}', ticketDetails.guid);
       return { action: "redirect", content: redirectUrl }
   } 
}
catch (e) {
return JSON.stringify(e)
}

return "Not able to redirect to ticket " + ticketToRedirect;