The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Create tasks from form onsubmit

allen_pitts
Giga Expert

Hello implement community,

 

A new server request has been implemented in the Service Catalog.

To get new server requests out of the emails and hallway conversations

the Service Catalog item was kept simple so it could be implemented

immediately. Right now the Service Catalog item creates a Request,

a Request Item, a Notification and a Request Task.

 

The task and notification goes to the engineer that coordinates new servers   who

then uses an application developed for this purpose called Operational

Projects or Ops Projects. The engineer creates nine tasks associated

with the Ops Project.

 

The tasks would be created from the OnSubmit event at the Ops Project

form when the field labeled 'Project Type' equals "New Server'.

Business rule condition
u_ops_project.u_project_type.indexOf("New System") == 0

Several of the fields from the Ops Project form will auto populate

in the Ops Projects Tasks.

 

If the Sys Admin training is remembered correctly, the way to get the
tasks created by the system would be a business rule as opposed to a client script

because the script must run at the server to create the tasks.

Any tips, tricks or pitfalls? Syntax for creating tasks in business rule?

Thank

 

Allen Pitts
LHP Hospital Group

1 ACCEPTED SOLUTION

domaners
Kilo Guru

Personally I would recommend using a Workflow to handle this type of activity, as you can template your individual tasks without the need for using code. However, if you do need to script these events, use a Glide Record to create the tasks. Article:



GlideRecord - ServiceNow Wiki



Cheers, Adam


View solution in original post

10 REPLIES 10

Inactive
Mega Expert

Allen,



You are correct. I would build a business rules that runs to create the new tasks. One way is to build a "task dictionary" that you is a sort of template for the new tasks you will be creating. This removes the need to hard code the tasks in the business rule. From an administration standpoint you would just maintain the dictionary.



Adam also hit the nail on the head with another great solution: Workflows.



The Glide Record article he linked is the code you would use in the Business Rule.