Auto creation of change tasks

Yogesh Bhola
Tera Contributor

HI need suggestion i have a requirement to when a normal/routine change is created all sub task will get created and assigned to required groups

8 REPLIES 8

Bert_c1
Kilo Patron

First, I assume you know what change_task records you want to create for a new CHG with type = "normal". If so, create a business rule on the change_request table, runs on Insert, and has Condition "Type", "is", "Normal".  And 'Advanced' checked, and a script like the following:

 

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

	// Create change_task records
	var ctRec = new GlideRecord('change_task');
	ctRec.initialize();
	// set parent change request
	ctRec.change_request = current.sys_id;
	// set additional fields as desired

	ctRec.insert();
})(current, previous);

 

Repeat script logic to create additional change_task records as desired.

Hi Bert,

 

Thanks can it be possible from using templates?

Hi Yogesh,

 

I'm not familiar with templates, so others will have to comment on that aspect.  Good luck.

Yes, you can.  I'd recommend using the Standard Change Management template management features released a few versions back though.

If you want to avoid the template approval and management that it brings in, you can use regular templates and create tasks also...with the one caveat that to use the template with tasks generated, you have to access it via the left navigation.  Applying the template to the record in the record screen will not spawn the tasks. 

Create your change request template first and then link additional change request tasks to it under Next Related Child Template...

DanT__0-1676061187668.png

Build out your template fields as necessary.

Next is a change task template - note the table name change here.

DanT__1-1676061388398.png

To add more tasks, you keep linking to additional change task templates in the Next Related Template field.

DanT__2-1676061607637.png

And so on...linking more change task templates.

Now add the change request template to the left navigation...

DanT__3-1676062121257.png

 

We used to manage dozens of these before we went to the Standard Change module.

 

Have fun!

 

Dan T

(requisite message to mark this as helpful and give a thumbs up if you like my answer and those fancy green underlines in the screen shots!)