Incident's short description should get auto populate to incident task while creation of incident task. How to do this by using client script?

Shraddha desai
Tera Contributor

Incident's short description should get auto populate to incident task while creation of incident task. How to do this by using client script.

How to do this?

1 ACCEPTED SOLUTION

Shakeel Shaik
Giga Sage
Giga Sage

Hi @Shraddha desai ,

 

with TWO Methods we can achieve this requirement.

1. getReference

2. GlideAjax

 

here is the getReference method:

function onLoad() {
   //Type appropriate comment here, and begin script below
    var info = g_form.getReference('incident', populate);

    function populate(info) {

        g_form.setValue('short_description', info.short_description); //Here Prod is my backend value of Short Description Choice
        //Demo Syntax
        //g_form.setValue('<Catalog_variable_new_environment_Value>','<Prod_choice_value>');
    }
}

 

If my response is helpful, then Please mark as Correct Answer/Helpful.

Please check and let us know.

Thanks 🙂

Shakeel Shaik.

 

Thanks,
Shakeel Shaik 🙂

View solution in original post

2 REPLIES 2

Sourabh26
Giga Guru

Hi,

 

You should do it using BR as below - 

BR (After)

Table - Incident Task

var parentInc = current.parent;
var grInc = new GlideRecord('incident');
if(grInc.get('sys_id',parentInc )){
  current.short_description = grInc.getValue('short_description');
  current.update();
}

 

Mark this as Helpful/Correct, if Applicable.

 

Regards,

Sourabh

 

Shakeel Shaik
Giga Sage
Giga Sage

Hi @Shraddha desai ,

 

with TWO Methods we can achieve this requirement.

1. getReference

2. GlideAjax

 

here is the getReference method:

function onLoad() {
   //Type appropriate comment here, and begin script below
    var info = g_form.getReference('incident', populate);

    function populate(info) {

        g_form.setValue('short_description', info.short_description); //Here Prod is my backend value of Short Description Choice
        //Demo Syntax
        //g_form.setValue('<Catalog_variable_new_environment_Value>','<Prod_choice_value>');
    }
}

 

If my response is helpful, then Please mark as Correct Answer/Helpful.

Please check and let us know.

Thanks 🙂

Shakeel Shaik.

 

Thanks,
Shakeel Shaik 🙂