how to set values to request field using workflow

Vijay Kumar4
Mega Guru

I have Created a catelog item.

find_real_file.png

 

When the catelog item submits I want to set defalut values to some fields. I created a workflow using sc_request , but it is not shown in the catelog item.

find_real_file.png

find_real_file.png

 

 I want to set these values in request form. But iam not able to add this workflow to my catelog item. Becouse this workflow is created using sc_request table. 

 

Please help me.

1 ACCEPTED SOLUTION

Why you want to create the workflow on request?

Create it on RITM and then in the workflow you can use Run Script activity to set the required values on request form.

find_real_file.png

Script for Run Script activity

var grReq = new GlideRecord('sc_request');
grReq.get(current.request.sys_id);
//Replace your field and values as per the need.
grReq.cmdb_ci = '261b2b426fb4110015c9181d5d3ee413';
grReq.impact = '3';
grReq.short_description = 'THIS IS TEST TICKET' ;
grReq.update();

 

Mark this as Helpful/Correct, if Applicable.

 

Regards,

Sourabh

View solution in original post

4 REPLIES 4

Sourabh26
Giga Guru

Hi,

 

Without anything shared how you think anyone can help you.

please check my screenshots

Why you want to create the workflow on request?

Create it on RITM and then in the workflow you can use Run Script activity to set the required values on request form.

find_real_file.png

Script for Run Script activity

var grReq = new GlideRecord('sc_request');
grReq.get(current.request.sys_id);
//Replace your field and values as per the need.
grReq.cmdb_ci = '261b2b426fb4110015c9181d5d3ee413';
grReq.impact = '3';
grReq.short_description = 'THIS IS TEST TICKET' ;
grReq.update();

 

Mark this as Helpful/Correct, if Applicable.

 

Regards,

Sourabh

Thanks this approach works well.