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.

Create Case or Incident via UI Action based on Conditions

morrix3
Giga Expert

Hello:

The following is what I need to accomplish:

Table: [Interaction]

Application: ITSM Workspace & Customer Service

Within the Agent Workspace Interaction there are a few UI Actions:

Create Incident - App: ITSM Workspace & Create Case - App: Customer Service

I need to deactivate these 2 and create a new one Called: Create Ticket.  This new UI Action should either create an Incident or a Case based on the Field: Account, if the account is such, generate an incident if it's this other then generate a Case.

I am puzzled about how to start this if I need to code everything in one UI Action? Or if I should create 2 UI Actions with the same name (Create Ticket) and then SHOW or HIDE based on the Account?

Please help; I would greatly appreciate any help with the Code that I would need for the UI Action or the conditions.

 

Thanks

 

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Morrix,

I recommend creating two UI actions based on the condition. Please refer below link to get started.

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/workspace/task/config...

 

- Pradeep Sharma

View solution in original post

10 REPLIES 10

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Morrix,

I recommend creating two UI actions based on the condition. Please refer below link to get started.

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/workspace/task/config...

 

- Pradeep Sharma

Pradeep:

How would i add the condition to show based on the Account? Could you help me with the script part?

Would it be like current.account == test and current.account != other_company? 

Could you help me with this part please?

Thanks for your help

Yes something like current.account == 'PASS SYSID OF THE RECORD' and for second UI action  current.account != 'PASS SYSID OF THE SAME RECORD from FIRST UI ACTION && current.account != 'PASS SYSID OF THE RECORD'

 

 

You are the best.

Thanks Pradeep.