- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2015 11:17 AM
I have a workflow on the sc_req_item table and the workflow has a script activity. In the script activity, I am trying to copy the value of the "short description" variable to the short description field of the parent Request.
I tried this with no luck.
sc_request.short_description = current.variables.short_description;
All help is appreciated!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2015 12:16 PM
Shane. My bad
Here is the updated script.
- //This function will be automatically called when this rule is processed.
- var gr = new GlideRecord('sc_request');
- gr.addQuery('sys_id',current.request);
- gr.query();
- while(gr.next())
- {
- gr.short_description = "Is this working?!"; //assuming short_description is the varaible part of catalog item
- gr.update();
- }
There was error on 2nd line. Try now pls.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2015 12:16 PM
Shane. My bad
Here is the updated script.
- //This function will be automatically called when this rule is processed.
- var gr = new GlideRecord('sc_request');
- gr.addQuery('sys_id',current.request);
- gr.query();
- while(gr.next())
- {
- gr.short_description = "Is this working?!"; //assuming short_description is the varaible part of catalog item
- gr.update();
- }
There was error on 2nd line. Try now pls.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2015 12:23 PM
Pradeep,
You are amazing!! I tested hard-coding per your last update and that worked. Then, I put the code for the short description variable back in and that worked also.
I've seen many responses from you on the Community and you are a great help. When I see code like this, I understand it, but writing it from scratch is such a challenge! Thank you very much for your help. I really appreciate it and will make your answer as correct.
//This function will be automatically called when this rule is processed.
var gr = new GlideRecord('sc_request');
gr.addQuery('sys_id',current.request);
gr.query();
while(gr.next())
{
gr.short_description = current.variables.short_description; //assuming short_description is the varaible part of catalog item
gr.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2015 12:27 PM
Hi Shane,
Thanks a lot for your feedback
I am glad I can be helpful to you.