UI Action

Mark Wood
Tera Contributor

Hello Experts,

I want to show the UI Action button on the incident form only if the incident's affected CI count is greater than 2.

How can I achieve please guide me on this?

Thank You.

 

1 ACCEPTED SOLUTION

Kalyani Jangam1
Mega Sage

Hi @Mark Wood 

Create or use existing server side script include with following code

Screenshot 2023-11-22 at 1.23.20 PM.png

Script include code

*************************************************************************************

CheckCI: function(num) {
 
var gr = new GlideRecord('task_ci');
gr.addQuery('task', num);
gr.query();
var count=gr.getRowCount();
if(count>2){
 
return true;
}else{
return false;
}
},

*************************************************************************************

call this script include in condition of ui actions condition like below

Screenshot 2023-11-22 at 1.23.46 PM.png

Please try and Mark Helpful and Correct if it really helps you.

View solution in original post

3 REPLIES 3

Sonam_Tiwari
Kilo Sage

Hi @Mark Wood ,

Can you please support your query with few screenshorts of your incident form?

Consider indicating the response as helpful and marking it as correct if it meets your needs.

AshishKM
Kilo Patron
Kilo Patron

Hi @Mark Wood ,

Is the affected CI added on Incident form or under related list ?

 

-Thanks,

Ashish


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Kalyani Jangam1
Mega Sage

Hi @Mark Wood 

Create or use existing server side script include with following code

Screenshot 2023-11-22 at 1.23.20 PM.png

Script include code

*************************************************************************************

CheckCI: function(num) {
 
var gr = new GlideRecord('task_ci');
gr.addQuery('task', num);
gr.query();
var count=gr.getRowCount();
if(count>2){
 
return true;
}else{
return false;
}
},

*************************************************************************************

call this script include in condition of ui actions condition like below

Screenshot 2023-11-22 at 1.23.46 PM.png

Please try and Mark Helpful and Correct if it really helps you.