Copy description from Change Request to Change Task

peggy1
Kilo Contributor

Hi,

I have been trying to auto populate description value from a Change Request to Change Task. Not having any luck Been trying to use

Business Rules.

At present, we have a standard change template that has change tasks automatically populated through Execution Plans.

I would like all the change tasks to have the description field to be the same as the parent Change Request's description upon creation of the tasks.

I've read different posts here but most are scripts for workflow.   But I'm not using a workflow.   Is there a Business Rule script/set up I could use to do so?

Your help will be greatly appreciated.   Thanks.

1 ACCEPTED SOLUTION

Hi Peggy,



Your script seems to be fine.



Are you sure, the 'Description' value from Change request does not copy over AFTER you insert the Change-Task record ?



I've just tried the below in my personal instance and working as expected:


chg_task_desc1.PNG


chg_task_desc2.PNG


View solution in original post

12 REPLIES 12

peggy1
Kilo Contributor

Thanks Samiul.   That's brilliant! I didn't have to use Script.   Followed your steps.



Thanks, its working now


peggy1
Kilo Contributor

Now that I have this working, the user wanted something more now.



Are we also able to add in the change task description a text and then some values (not all values) of description from the parent change request?



A way of example would be, the change task description to be "Notification of <insert part of text from description of change request>"



Is this possible abhinay samiul   ?


Hi Peggy,



The following will give you some idea to accomplish your requirement:



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



  var change_description = current.change_request.description;


  var part_of_description = change_description.slice(3); //http://www.w3schools.com/jsref/jsref_slice_string.asp


  var modified_description = "Notification of "+part_of_description;



  current.description = modified_description;



})(current, previous);



chg_task_desc1.PNG


chg_task_desc2.PNG


chg_task_desc3.PNG