How to modify a submission message after a request is submitted

gaurip
Mega Expert

Hi,

I'm working on a Service Portal. I want to modify submission message (in green) when a request is submitted. Screenshot as below.

find_real_file.png

I want to display Requested Item Number instead of Request Number. After investigating this further, I have come to the conclusion that we'll have to modify the REST call in Client Controller. Not sure what I need to do in order to get RESPONSE as Requested Item and not as Request.

$http.post(spUtil.getURL('sc_cat_item'), t).success(function(response) {

                      var a = response.answer;

                      var n = a.number;

                   

                      $scope.$emit("$$uiNotification", response.$$uiNotification);

                      $scope.$emit("$sp.sc_cat_item.submitted", a);

                      if (n)

                              issueMessage(n, a.table, a.sys_id);

                      $scope.submitting = false;

                      $scope.submitButtonMsg = $scope.m.submittedMsg;

});

Can anyone suggest how to achieve this?

Thank you.

-Gauri

9 REPLIES 9

nathanfirth
Tera Guru

Gauri,



Sadly this information is not contained in the response from the API. So what you have to do in the "success" callback function is make a AJAX call to the server (server.update) and use GlideRecord to get the req_item and then place it back on "data". It's pretty simple to do and only takes a few lines of code. Personally I think this is a defect in how the SP Catalog API works because it's strips out valuable information from the response, and because it happens in Java we don't have access to modify it. I've raised this as an issue to the Service Portal team.


Thanks Nathan. Will try that.



-Gauri


Ayushi1
Tera Contributor

Did anyone try it ? Please let me know 

 

Thanks 

bobbyclarky
Kilo Explorer

Hi Gauri,



Did you find a solution for this issue? I have to do the same but I don't find a good way to do it.



Thanks in advance,