I want to display the variable in notification which is available on the catalog form

Naga13
Tera Contributor

Hi Team,

I want to display the variable in notification which is available on the catalog form, i will create the notification on sc_task table, before that

Can anyone suggest the sample  email script here.

Assume variable name is "end_date_time".

Thanks in advance

 

1 ACCEPTED SOLUTION

Hello Naga,

Please follow the above method mentioned by me

Thanks.

View solution in original post

23 REPLIES 23

In your workflow you need to add Variables add variables on your catalog task as given below:

find_real_file.png

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Hi Anil,

I have created sc_task through script activity in workflow not used catalog task activity, in this case how can i pull required variables on sc_task table.

Regards

Naga

Hello,

1. Go to your catalog item.

2. Check the related list for Variables on your item.

3. Pull the 'global' field in the list view of your variables related list by clicking the gear icon or by list layout.

4. Set it as true for the variables you want to make visible everywhere. like on RITM and tasks as well.

or 

instead of 3rd step you can open then variable from the list of variables and select the check box 'Global'. And then repeat the same for all the variables you want to show.

 

Naga13
Tera Contributor

Hi Anil,

Please find the below script

var idnum = current.sys_id;
var ritmGR = new GlideRecord('sc_req_item');
if (ritmGR.get(idnum)) {

mrvs = ritmGR.variables.cmdbid;

var grServer = new GlideRecord('cmdb_ci_server');
grServer.addQuery('sys_id', mrvs);
grServer.query();
var asgnGroup = '';
if (grServer.next()) {
asgnGroup = grServer.assignment_group.toString();
}

var teskDesc = grServer.assignment_group;

var grServer1 = new GlideRecord('sc_task');
grServer1.initialize();
grServer1.assignment_group = asgnGroup;
grServer1.request_item = idnum;
grServer1.request = current.request;

if (grServer.assignment_group.getDisplayValue() == "x") {
grServer1.short_description = "Dear x, kindly execute request";
}
if (grServer.assignment_group.getDisplayValue() == "y") {
grServer1.short_description = "Dear Dear y, kindly execute request";
}
if (grServer.assignment_group.getDisplayValue() == "z") {
grServer1.short_description = "Dear z, kindly execute request";
}
grServer1.insert();
//grServer1.update();
}

 

Hello Naga,

Please follow the above method mentioned by me

Thanks.