cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
910
Views
1
Helpful
0
Comments
Orf Gelbrich
Cisco Employee
Cisco Employee
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

CategoryWorkflow
ComponentsvSphere 5.x
User Inputs


Instructions for Regular Workflow Use:

  1. Download the attached .ZIP file below to your computer. *Remember the location of the saved file on your computer.
  2. Unzip the file on your computer. Should end up with a .WFD file.
  3. Log in to UCS Director as a user that has "system-admin" privileges.
  4. Navigate to "Policies-->Orchestration" and click on "Import".
  5. Click "Browse" and navigate to the location on your computer where the .WFD file resides. Choose the .WFD file and click "Open".
  6. Click "Upload" and then "OK" once the file upload is completed. Then click "Next".
  7. Click the "Select" button next to "Import Workflows". Click the "Check All" button to check all checkboxes and then the "Select" button.
  8. Click "Submit".
  9. 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:

Screen Shot 2017-03-21 at 10.09.42 AM.png

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

Screen Shot 2017-03-21 at 10.15.37 AM.png

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:

Screen Shot 2017-03-21 at 10.06.31 AM.png

Here is the code for the reject link:

Screen Shot 2017-03-21 at 10.06.56 AM.png

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:

Screen Shot 2017-03-21 at 10.09.56 AM.png

Screen Shot 2017-03-21 at 10.10.02 AM.png

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

Screen Shot 2017-03-21 at 9.55.19 AM.png

My test workflow :

Screen Shot 2017-03-21 at 9.55.47 AM.png

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).

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links

Review Cisco Networking for a $25 gift card