I want list of incident records using background script that created 10 days ago from now ?

Abhishek Kathe
Mega Guru
 
1 ACCEPTED SOLUTION

Prasanna Kumar7
Tera Expert

Hi @Abhishek Kathe,

 

Please find the filter that we need to apply to get the incidents created 10 days ago from now.

 

PrasannaKumar7_0-1695040328451.png

 

Query = sys_created_onRELATIVEGT@dayofweek@ago@10

 

Please Click helpful if you got the answer.

 

Kind Regards,

Prasanna

 

View solution in original post

8 REPLIES 8

Jaspal Singh
Mega Patron
Mega Patron

Hi Abhishek,
Unsure of the use case. However, you can get all of details form the list view. Why is there a need for background script or any other script.

trying un-explored scenarios.

Try something as below.

var getincibefore= new GlideRecord('incident');
getincibefore.addEncodedQuery('sys_created_onRELATIVELT@dayofweek@ahead@10');
getincibefore.query();
while(getincibefore.next())
{
gs.print(getincibefore.number);
}

can you please show your filter that you copied a query from ?