How would I auto-close a task?

Blair5
Tera Guru

We have a business requirement to create a catalog item that will be used to report on changes made outside of service now. The group will submit the catalog item, and the task should be created and then automatically close. Could anyone give me some ideas on how to do this? Or links to WIKIs that may help?

Would I utilize business rules, or would the workflow take care of this?

Thanks!

4 REPLIES 4

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Probably a few different ways to do this, but I would put a business rule on the sc_task table that looked for any task where current.request_item.cat_item == 'Your item', and sets it to closed.


ShaneBrazeal
Tera Contributor

Another way to do this would be to use the workflow - just check the advanced button on the Catalog Task activity and use something like the following for the script:



task.state = 3; //closed complete
task.active = false;


Oh yeah, much simpler 🙂 That's probably the best way to go.


jugantanayak
Tera Guru

It worked successfully.

Thanks