Pop up message when ever configuration item (CI) field is empty in incident

arsh
Tera Contributor
  • Whenever a user close and save incident from if CI field is empty A Pop up message should come when ever configuration item (CI) field is empty in incident while closing the incident ticket and it should come for some selected groups only (3 to 5 groups)
4 REPLIES 4

swathisarang98
Giga Sage
Giga Sage

Hi @arsh ,

 

You can write a simple business rule 

Table: Incident

check advanced 

Before update

 

Here i am checking incident assignment group not logged in user is part of assignment group if you want to check logged in user then you can do it through script 

swathisarang98_0-1710010215326.png

 

 

and in action tab please set the message and check abort action as shown below,

swathisarang98_1-1710008651034.png

 

if you are checking logged in user is member of any group in script part you can write this and remove everything from action tab,

 

(function executeRule(current, previous /*null when async*/) {

	var a = gs.getUser().isMemberOf('assignment group name');
	var b = gs.getUser().isMemberOf('second assignment group name');

	if( a == true || b == true){
		gs.addErrorMessage('Please Select the configuration item');
		current.setAbortAction(true);
	}

})(current, previous);

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

 

 

@arsh , you can change the condition according to your need 

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

@arsh Thanks for marking my answer as helpful. If it helped you in any way please accept the solution so that it will be beneficial to the future readers with the same query

shyamkumar VK
Kilo Patron

@arsh ,

If you want the field to populate by that group Just configure UI policy with condition as State is Resolved and Assignment group is xyz

 

then under UI policy Action create an entry for CI and enable Mandatory to True

 

In the Run script add this  Message

g_form.addInforMessage(‘please populate CI details’);

 

add this in if condition true script

let me know if you need any more information 


Regards,

Shyamkumar

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar