Create Approval on Catalog task (sc_task)

Lylys
Giga Contributor

Hello Everybody,

I have an question:

It's possible create sc_task with Approval from the workflow.

I need create several sc_task with differents users approvals because I search by script the differents approval users.

 

It's possible to script?

Thanks a lot.

Best regard

6 REPLIES 6

Utpal Dutta1
Mega Guru

Hey Lylys,

Yes you can send approval by Gliding sysapproval_approver, Here is how you can do it:

 

Script:

 I used this script for incident form you can modify it according to your need

var gr=new GlideRecord('sysapproval_approver');
gr.initialize();
gr.sysapproval=current.sys_id;   (Modifiable)
gr.approver=current.assigned_to.manager;  (Modifiable)
gr.state='requested';
gr.insert();

 

By writing this script you will be able to send the approval from anywhere.

 

Please mark my comment helpful and if i was able to resolve your query then Please mark Correct and close the thread.

 

Thanks and Regards:

 

Utpal Dutta

DxSherpa Pvt. Ltd.

Hello @Utpal Dutta

Thanks for your response.

I test this script, but the approval doesn't create on my task. 
I tried this script on the create task activity:

But It's doen't run, after I put the script after the task activity, it's not possible because, the approvers are create when the task is close.

 

var gr=new GlideRecord('sysapproval_approver');
gr.initialize();
gr.sysapproval=task.sys_id;   
gr.approver=current.assigned_to.manager;  
gr.state='requested';
gr.insert();

 

Thanks,

Lylys

It will be created under sysaporoval_approver table

Sorry I don't undestand your response.