Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Details for change approvals in employee service center My Tasks or My todos.

Kishor O
Tera Sage

I have a requirement to show the details tab under change request approval in the employee service center portal.
For Ritm , approval request we are able to see the details tab. How we can achieve the same for change approval? 
Or how we can add information under . CHANG*### overdue 2 days (Please refer

 image attached)

                                                                      Requested for:   Kishor

                                                                      Assigned to:   **
                                                                      Planned start date:  ** 

                                                                      Planned end date: **

*2nd image is for Ritm approval request. Here we can see details tab.

MicrosoftTeams-image (22).pngMicrosoftTeams-image (17).png

1 ACCEPTED SOLUTION

Kishor O
Tera Sage

1.Modify server script in todos approval  from 25th line 

  data.source = sysApprovalRecord.source_table;
            if (data.source == 'change_request') {
                data.risk1 = sysApprovalRecord.sysapproval.risk.getDisplayValue();
                data.start_date = sysApprovalRecord.sysapproval.start_date;
                data.end_date = sysApprovalRecord.sysapproval.end_date;
                data.state = sysApprovalRecord.sysapproval.state.getDisplayValue();
                data.approvalText0 = gs.getMessage("Short description: {0}", data.shortDescription);
                data.approvalText2 = gs.getMessage("Risk: {0}", data.risk1);
                data.approvalText4 = gs.getMessage("Planned start date: {0}", data.start_date);
                data.approvalText6 = gs.getMessage("Planned end date: {0}", data.end_date);
                data.approvalText8 = gs.getMessage("State: {0}", data.state);
  data.approvalText7 = gs.getMessage("Do you want to approve the Change Request?");
 
            } else if(data.source != 'change_request'){
                data.approvalText1 = gs.getMessage("Do you want to approve the following: {0}?", data.shortDescription);
}
 
2. Modify html code as per getmessage variable.
 
<h4 id="approval-message" ng-if="!data.isPosted">{{data.approvalText1}}</h4>
<h4 id="approval-message" ng-if="!data.isPosted">{{data.approvalText0}}</h4>
<h4 id="approval-message" ng-if="!data.isPosted">{{ data.approvalText2}}</h4>
<h4 id="approval-message" ng-if="!data.isPosted">{{ data.approvalText4}}</h4>
<h4 id="approval-message" ng-if="!data.isPosted">{{ data.approvalText6}}</h4>
<h4 id="approval-message" ng-if="!data.isPosted">{{ data.approvalText8}}</h4>
<h4 id="approval-message" ng-if="!data.isPosted">{{ data.approvalText7}}</h4>
 
 
testttttttttpesc.png

View solution in original post

2 REPLIES 2

Kishor O
Tera Sage

1.Modify server script in todos approval  from 25th line 

  data.source = sysApprovalRecord.source_table;
            if (data.source == 'change_request') {
                data.risk1 = sysApprovalRecord.sysapproval.risk.getDisplayValue();
                data.start_date = sysApprovalRecord.sysapproval.start_date;
                data.end_date = sysApprovalRecord.sysapproval.end_date;
                data.state = sysApprovalRecord.sysapproval.state.getDisplayValue();
                data.approvalText0 = gs.getMessage("Short description: {0}", data.shortDescription);
                data.approvalText2 = gs.getMessage("Risk: {0}", data.risk1);
                data.approvalText4 = gs.getMessage("Planned start date: {0}", data.start_date);
                data.approvalText6 = gs.getMessage("Planned end date: {0}", data.end_date);
                data.approvalText8 = gs.getMessage("State: {0}", data.state);
  data.approvalText7 = gs.getMessage("Do you want to approve the Change Request?");
 
            } else if(data.source != 'change_request'){
                data.approvalText1 = gs.getMessage("Do you want to approve the following: {0}?", data.shortDescription);
}
 
2. Modify html code as per getmessage variable.
 
<h4 id="approval-message" ng-if="!data.isPosted">{{data.approvalText1}}</h4>
<h4 id="approval-message" ng-if="!data.isPosted">{{data.approvalText0}}</h4>
<h4 id="approval-message" ng-if="!data.isPosted">{{ data.approvalText2}}</h4>
<h4 id="approval-message" ng-if="!data.isPosted">{{ data.approvalText4}}</h4>
<h4 id="approval-message" ng-if="!data.isPosted">{{ data.approvalText6}}</h4>
<h4 id="approval-message" ng-if="!data.isPosted">{{ data.approvalText8}}</h4>
<h4 id="approval-message" ng-if="!data.isPosted">{{ data.approvalText7}}</h4>
 
 
testttttttttpesc.png

Hi @Kishor O ,

After cloning the todo approval and after making the changes, from where do we need to call this cloned widget? Could you please help me with the same?