The CreatorCon Call for Content is officially open! Get started here.

Portal widget issue

RoseD
Giga Contributor

Hi,

In Incident Standard ticket Action widget, when resolved is clicked it will open a Modal and that comment will be added to the worknote. I am getting error.

HTML:

<ul class="dropdown-menu pull-right" id="actionList">
            <li>
                <a ng-if="data.canResolve" href="javascript&colon;void(0)" ng-click="$event.stopPropagation();resolveIncident()" data-toggle="modal" data-target="#myModal">${Resolve}</a>
            </li>

........
<div id="myModal" class="modal fade">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Please let us know the reason your issue no longer needs investigating:</h4>
      </div>
      <div class="modal-body">

        <textarea id="reason" name="reason" rows="4" cols="50" ng-change="getComments(comments)" ng-model="comments">
        </textarea>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="c.uiAction1('ok')">${OK}</button>
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>

  </div>
</div>

Client:
 $scope.resolveIncident = function() {
        $scope.data.action = 'resolveIncident';
			
				//RD			
				var textarea = document.getElementById('reason');
        textarea.value = '';
				//RD
			
        $scope.server.update(init).then(function(response) {
            if (response.isIncidentResolved)
                spAriaUtil.sendLiveMessage(c.resolvedIncidentMsg);
        });
        $scope.$emit('focusOnActions', {
            "isFocusRequired": true
        });
    };

	//RD
		   c.uiAction1 = function(action1) {

        c.data.action1 = action1;
        c.server.update().then(function() {

            //c.data.action = undefined;
            c.data.action1 = undefined;
        })

    }
    $scope.getComments = function(com) {
        c.data.getComments = com;
        c.server.update();

    }

Server:
  var act1 = input.action1;
    if (input.action1 == "ok") {
    	if (input && input.action == 'resolveIncident' && incidentGr.get(incidentSysId)&& input.getComments) {
        incidentGr.incident_state = global.IncidentState.RESOLVED;
				incidentGr.state = global.IncidentState.RESOLVED;
				incidentGr.resolved_by = gs.getUserID();
			
				incidentGr.comments="Resolved by colleague:"+"\n"+input.getComments;
				incidentGr.close_notes="Resolved by colleague:"+"\n"+input.getComments;
				data.isIncidentResolved = incidentGr.update();
  	  }
		}

 

RoseD_0-1711376027202.png

 

1 REPLY 1

Neel Patel
Tera Guru

Hi Rose,

 

you are setting the value to it to ‘undefined’

 

c.data.action1 = action1;
        c.server.update().then(function() {

            //c.data.action = undefined;
            c.data.action1 = undefined;
        })