The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to get the Task ID and status by passing Request number or RITM number

SMArjun
Kilo Contributor
 
2 REPLIES 2

Chinmay Tawade1
Tera Guru

Hi Arjun,

Be it task or sc_task table using parent field on both the table you can get the task and its status.

You need to glide the respective table using, ritm sysid you can query on that table.

Assuming you will use script to get the task status, below is the code -

 
var task = new GlideRecord('task');// Glide on Task Table
task.addEncodedQuery('parent=aec79906eb43011008f2951ff15228f0'); //here pass the ritm sys id
task.query();
while(task.next()){ // you will get all the task related to specified ritm above
    gs.info('Task Number - '+task.number+ ' Task Status - '+task.state); // print the task number and its status.
}
 
Please mark as helpful if this answers your question, or let me know if any help needed further.
 
Thanks,
Chinmay T

Ankur Bawiskar
Tera Patron
Tera Patron

@SMArjun 

what's your actual business requirement?

are you planning to write script for this? if yes then where?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader