Put the same category,subcategory and CI the task to the change request (parent)

williams2
Tera Expert

Hello, how can I assign the same category, subcategory and Configuration item from the Task catalog to a change request (parent) generated from a task (related list)?

williams2_1-1735945918083.png

 




williams2_0-1735945727466.png

 

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@williams2 

you can use before insert BR on change_request table

Condition: current.parent != ''

Script:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	current.category = current.parent.category;
	current.cmdb_ci = current.parent.cmdb_ci;

})(current, previous);

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

Runjay Patel
Giga Sage

Hi @williams2 ,

 

You can write before insert BR on change request table and use below script.

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	current.category = current.parent.category;
current.sub_category = current.parent.sub_category;
	current.cmdb_ci = current.parent.cmdb_ci;

})(current, previous);

 

RunjayPatel_0-1735975975028.png

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

View solution in original post

In this video i have explained about Web service integration in ServiceNow like how it works, how we can configure it, what are the prerequisite and many more. I have covered below topics in this video. 1. understand Web Service. Like when and how we will use it. 2. Talked about Inbound and ...
6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@williams2 

you can use before insert BR on change_request table

Condition: current.parent != ''

Script:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	current.category = current.parent.category;
	current.cmdb_ci = current.parent.cmdb_ci;

})(current, previous);

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

@williams2 

Hope you are doing good.

Did my reply answer your question?

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

 It worked fine, thank you very much for your help
regards

Runjay Patel
Giga Sage

Hi @williams2 ,

 

You can write before insert BR on change request table and use below script.

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	current.category = current.parent.category;
current.sub_category = current.parent.sub_category;
	current.cmdb_ci = current.parent.cmdb_ci;

})(current, previous);

 

RunjayPatel_0-1735975975028.png

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

In this video i have explained about Web service integration in ServiceNow like how it works, how we can configure it, what are the prerequisite and many more. I have covered below topics in this video. 1. understand Web Service. Like when and how we will use it. 2. Talked about Inbound and ...