Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Can we create Approvals under Task table

Aruna Sree Yela
Tera Guru

Hi,

 

Can we create approvals under task table?

 

Scenario:

 

There is a case table which is having task records generated once RP gets submitted.

I wanted to create approvals under task record but not on case record.

 

Thanks

 

6 REPLIES 6

Dr Atul G- LNG
Tera Patron

Hi @Aruna Sree Yela 

 

I think no, as it is on case so approval will be on case.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

vermaamit16
Kilo Patron

Hi @Aruna Sree Yela 

 

Have you tried creating the Approval using Flow action "Ask for Approval" ? You can map a task record for creating approval on it. You can also read this blog which could be helpful https://www.servicenow.com/community/itom-blog/seeking-approval-part-2-task-vs-non-task-approvals-an...

 

Thanks & Regards

Amit Verma

Thanks and Regards
Amit Verma

Hi @vermaamit16 , How can I do that in workflow please?

Hi @Aruna Sree Yela you would need to place the script where you create the task

var task = new GlideRecord('sc_task'); task.initialize();

 

var sysid = task.insert();

 

// Create a new approval record

var approvalRecord = new GlideRecord('sysapproval_approver');

approvalRecord.setValue('document_id', sysid);

approvalRecord.setValue('approver', 'user_sys_id'); // Replace 'user_sys_id' with the Sys ID of the approver

approvalRecord.setValue('state', 'requested');

approvalRecord.insert();

}

 

Regards
Harish