Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

we want to hide form action of create incident from form context menu of SIR form

Siva_Prasad
Tera Contributor

we want to hide form action of create incident from form context menu of SIR form after one incident is created from the security incident ?Is there any solution for this?

 

18 REPLIES 18

Siva_Prasad_1-1761542225574.png

 

we want to hide this create incident action after one incident is created from security incident 

 

@Siva_Prasad 

Steps

1) search in form actions in left nav

2) enter your security incident table name and the button label

AnkurBawiskar_0-1761543353827.png

 

3) once you find that button, add the script condition by calling script include and pass current sysId

AnkurBawiskar_1-1761543401491.png

 

4) script include function will check if this security incident already has INC or not, if yes then return false, if not then return true

Note: check how INC is linked with Security Incident i.e. via parent field and based on that have your logic

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,
already script condition is there in that form action ,
current.active == true && new sn_sm.SMConfiguration().hasRole(current, "basic") 
do i need to add new condition or add condition to existing one?

 

@Siva_Prasad 

yes add 1 more like this

current.active == true && new sn_sm.SMConfiguration().hasRole(current, "basic") && new ScriptIncludeName().alreadyHasIncident(current)

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ok thank you , let me check