How to display a message "Awaiting User Info" on the RITM ticket form when RITM is in pending state

Meghana3
Tera Contributor

Hi All,

We have a Requirement to display a message "Awaiting user info" on the RITM ticket conversation page when the RITM is in pending state.

Please find the attached below screenshot for more detail:find_real_file.png

Any suggestion to active this requirement will be much appreciated. 

 

Thanks in advance

Regards,

Meghan

1 ACCEPTED SOLUTION

Vamshi dhar
Kilo Guru

Hi Meghana,

Please follow the below steps, your requirement will be fulfilled.

1. Create a new widget and update the below code in widget.

 Code Snippet:

HTML COde:

<div class="alert alert-success" role="alert" ng-if="data.messages"><small>{{data.messages}}</small></div>

Server Side:

(function() {
data.messages;
data.sys_id=$sp.getParameter('sys_id');

var reqItem=new GlideRecord('sc_req_item');
reqItem.addQuery('sys_id',data.sys_id);
reqItem.query();
if(reqItem.next()){

if(reqItem.state=='-5'){
data.messages="Awaiting User Info";

}

else{

data.messages="Custom Message";

}//Write your condition and messages here

}
})();

 

Step2: After Creating New Widget, Navigate to Service Portal -> Pages -> Search for Ticket Form(Id-Ticket). Open Page in Designer and place your newly created Widget as per your convenience.

Please find the attached screenshot.

 

Please Mark it as Correct if it fulfills your requirement

 

Thanks

Vamshidhar

View solution in original post

3 REPLIES 3

Vamshi dhar
Kilo Guru

Hi Meghana,

Please follow the below steps, your requirement will be fulfilled.

1. Create a new widget and update the below code in widget.

 Code Snippet:

HTML COde:

<div class="alert alert-success" role="alert" ng-if="data.messages"><small>{{data.messages}}</small></div>

Server Side:

(function() {
data.messages;
data.sys_id=$sp.getParameter('sys_id');

var reqItem=new GlideRecord('sc_req_item');
reqItem.addQuery('sys_id',data.sys_id);
reqItem.query();
if(reqItem.next()){

if(reqItem.state=='-5'){
data.messages="Awaiting User Info";

}

else{

data.messages="Custom Message";

}//Write your condition and messages here

}
})();

 

Step2: After Creating New Widget, Navigate to Service Portal -> Pages -> Search for Ticket Form(Id-Ticket). Open Page in Designer and place your newly created Widget as per your convenience.

Please find the attached screenshot.

 

Please Mark it as Correct if it fulfills your requirement

 

Thanks

Vamshidhar

Hi Meghana,

Any update on this thread.

 

 

Thanks

Vamshidhar

DirkRedeker
Mega Sage

Hi

Have you tried with:

spUtil.addInfoMessage('here is my message');

in the "Client Controller" of your widget?

Let me know if that answers your question and mark my answer as correct and helpful.

BR

Dirk