Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Variable editor on SCTask is missing if SCTask is created using run script not with workflow activity.

Mrunal Nagarkar
Tera Contributor

I am creating catalog task using run script. once catalog task is created Variables (which shows all variables from RITM) is missing. 

var gr = new GlideRecord('sc_task');
gr.initialize();
gr.request_item = current.sys_id;
gr.request = current.request;
gr.short_description = 'Description';
gr.insert();

I am using above script. Please guide me how to show Variable editor on SCTASK

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Hey,

Variables from catalog is visible on catalog task when you would useon a Catalog Task step. The relation  is stored in sc_item_variables_task table

Using Run Script will not result into showing variables on the catalog task form.

But there's a workaround which you can use

Scripting with catalog variables on tasks (sc_item_option_mtom) table

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

Best Regards
Aman Kumar

View solution in original post

2 REPLIES 2

Aman Kumar S
Kilo Patron

Hey,

Variables from catalog is visible on catalog task when you would useon a Catalog Task step. The relation  is stored in sc_item_variables_task table

Using Run Script will not result into showing variables on the catalog task form.

But there's a workaround which you can use

Scripting with catalog variables on tasks (sc_item_option_mtom) table

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

Best Regards
Aman Kumar

Jaspal Singh
Mega Patron
Mega Patron

Hi Mrunal,

 

Why not use Catalog Task workflow activity instead of run script activity & then simply scroll & add variables. Something as below.

find_real_file.png

Picture above is just for reference however, variables may differ in your case.