Task Name | How to add and API call to and e-mail approval template and have a link for approve and reject |
Description | |
Prerequisites | Tested on UCSD 6.0.1.1 |
Category | Workflow |
Components | vSphere 5.x |
User Inputs | |
Instructions for Regular Workflow Use:
- Download the attached .ZIP file below to your computer. *Remember the location of the saved file on your computer.
- Unzip the file on your computer. Should end up with a .WFD file.
- Log in to UCS Director as a user that has "system-admin" privileges.
- Navigate to "Policies-->Orchestration" and click on "Import".
- Click "Browse" and navigate to the location on your computer where the .WFD file resides. Choose the .WFD file and click "Open".
- Click "Upload" and then "OK" once the file upload is completed. Then click "Next".
- Click the "Select" button next to "Import Workflows". Click the "Check All" button to check all checkboxes and then the "Select" button.
- Click "Submit".
- A new folder should appear in "Policies-->Orchestration" that contains the imported workflow. You will now need to update the included tasks with information about the specific environment.
This post was inspired by collaboration with Jeremiah. Thank you.
The desired outcome for 2 links to approve or reject a UCSD SR:

The default approval template only has a link to UCSD to log in:

In a approval task in a workflow the task can be expanded and the template made visible and added onto:
The actual template could also be adjusted or a new template could be created for this as well.
Here is the code for the approval link:

Here is the code for the reject link:

Here is the actual Code in ASCII format for easy cut and paste:
<p>
<Cloupia:ReportScript>
out.println('<a href="https://' + request.getDataObject().getSettings().getCuicIpAddress() +'/app/api/rest?formatType=json&opName=userAPIUpdateMyApproval&opData={param0:' + request.getDataObject().getObjects().getServcieRequest().getRequestId() + ',param1:' + request.getDataObject().getEntryId() + ",param2:'true',param3:'I approve this Request'}" + '">Approve</a>');
</Cloupia:ReportScript>
</p>
<p>
<Cloupia:ReportScript>
out.println('<a href="https://' + request.getDataObject().getSettings().getCuicIpAddress() + '/app/api/rest?formatType=json&opName=userAPIUpdateMyApproval&opData={param0:' + request.getDataObject().getObjects().getServcieRequest().getRequestId() + ',param1:' + request.getDataObject().getEntryId() + ",param2:'false',param3:'I reject this Request'}" + '">Reject</a>');
</Cloupia:ReportScript>
</p>
In the approval e-mail the mouse over check:


Once the link is selected and you are already logged onto UCSD with your browser the following should be visible:

My test workflow :

Side Notes:
This can be a approved from a iPhone or other portable device. The login for UCSD ends up with a white screen, but it the link for approval or reject is then selected from the e-mail it will approve or reject the SR. (Why is there a white screen on a portable device, the UCSD HTML5 interface is not yet mobile enabled).