Bulk Closure of Catalog Task

Mohammed Rahim
Giga Contributor

Hi all,

I have requirement for bulk Closure of outdated SCTASKs (Almost 12k records).

There is no particular filter I can use to filter the records and also no date range to select from. The records are scattered. The data was given by multiple teams and is now available as a consolidated excel report.

 

How can I close all the tickets using this excel data?

 

Thanks

 

1 ACCEPTED SOLUTION

@Mohammed Rahim  

since you said the file contains task number then do this

1) create data source of type excel

2) create transform map and field map for number

3) set coalesce on number field

use onBefore transform script to set the state

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

	// Add your code here
	target.state = 3;

})(source, map, log, target);

I shared solution for something similar 2 years ago

Bluk closure of 1200 task 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

6 REPLIES 6

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

If the data is available what are the fields available is the catalog task number there in the excel if yes just apply the filter number is one of  and copy paste the complete numbers from excel in one go.

 

Please mark my answer as correct based on Impact.

The Catalog Task number is available in the excel, what action to take to auto close all those task in ServiceNow through import.
Note - The sys ids for the tasks are not available in excel.

You can do it via import set and transform map or you ca do it via fix script/background script.

 

If doing by transform map keep the task number as coalesce and have the state updated to close complete with a script.

 

In case if you want to do it via fix script/background script you can add the query which i said number is one of in the encoded query and directly close it using the script.

 

Please mark my answer as correct based on Impact.

Hello,

 

If my answer helped you can you also mark it as correct.

 

Thanks.