Business rule to copy Description in Incident task table from description in incident table

Dilip Kumar R1
Kilo Contributor

Need a  business rule so that short Description in Incident(parent) is copied to short description in  Incident Task(child), when a Incident task is created.

5 REPLIES 5

OlaN
Giga Sage
Giga Sage

Hi,

Do you know that you can create a Flow that does the same, and doesn't require a single line of code?

Example:

find_real_file.png

 

Also, please avoid creating duplicate questions.

st27
Tera Contributor

Hi OlaN,

I am very keen in getting this flow work. I have created exactly the same and when I create Incident task, short description is not copied to task? IS there any thing missing? Thanks

Hard to tell without any details.

Can you share what you have created, then I might be able to help.

Praneeth8
Tera Contributor

Hi Dilip kumar,

 

you can write before business rule on Incident task table with insert or update condition.

 the code for your requirement is :

 

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

// Add your code here
var gr = new GlideRecord("incident");
gr.addQuery("sys_id",current.incident);
gr.query();
while(gr.next()){
current.description = gr.description;

}

})(current, previous);