- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
03-23-2022 03:15 AM
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?
Solved! Go to Solution.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
03-23-2022 03:59 AM
Hi 
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.
 
Shakeel Shaik 🙂
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
03-23-2022 03:23 AM
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
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
03-23-2022 03:59 AM
Hi 
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.
 
Shakeel Shaik 🙂
