Highlighted
Honored Contributor.
Honored Contributor.
560 views

Fetch the IM based on Update Time

Jump to solution

Hi,

 

I need to fetch the IM's based on condition as mentioned below. 

 

1) To check if there was an update in the last two days, if no update then it should fetch the related IM's.(in Otherwords, have to fetch IM tickets which was not update in last two days  )

 

Currently i'm using the below Query. Addition to this Query i need to add the above scenario. How to do that?


 var SCincidents = new SCFile("probsummary");
 var query ="priority.code=\"1\" and problem.status~=\"Closed\"";   
 var rc = SCincidents.doSelect(query);

Thanks in advance.

Regards,

Shalini R

0 Likes
1 Solution

Accepted Solutions
Highlighted
Honored Contributor.
Honored Contributor.
Now its working Fine. I have Used Below mentioned Query. var query ="priority.code=\"1\" and problem.status~=\"Closed\" and update.time < (tod()-'2 00:00:00')";

View solution in original post

0 Likes
6 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..
HI Shalini,

You can use the field "update.time" field which will give you the last update done on the record

Like update.time - tod()>"02:00:00:00"

i have not tried this,but you can use this field for your requirement.

Thanks
jagabandhu
0 Likes
Highlighted
Honored Contributor.
Honored Contributor.
Hi,
I have tried as you mentioned. But it doesn't work.

var query ="priority.code=\"1\" and problem.status~=\"Closed\" and (update.time - tod())>='02:00:00:00'";
0 Likes
Highlighted
Absent Member.
Absent Member.

Use to check update in last two days ,

(tod() - update.time )>='02:00:00:00'

since tod() will always be more than update.time, hence tod() should come first.

But this will Noy solve your query as mentioned in first post, you need few ‘if’ ‘else’ in your JS.

Regards,

____________________________________
Assign Kudo, if found post useful and mark it accepted if solves the issue.
0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Hi Piku,

 

Already i have tried as you  mentioned in the previous loop.

But Still its not working.

 

var query ="priority.code=\"1\" and problem.status~=\"Closed\" and (tod()-update.time)>'2 00:00:00')";

 

Javascript&colon;

{

 var SCincidents = new SCFile("probsummary");
 var query ="priority.code=\"1\" and problem.status~=\"Closed\" and (tod()-update.time)>'2 00:00:00')";
 var rc = SCincidents.doSelect(query);
 while (rc == RC_SUCCESS){
 SendMail(SCincidents);
 rc = SCincidents.getNext();
 }

 

 

Thanks & Regards,

Shalini R

 

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Hi PIku,

 

For testing purpose,

 

I tried by using Below mentioned Query,

 

var query ="update.time < (tod()-'2 00:00:00)'";

and

var query ="update.time < tod()-'2 00:00:00'";

 

Both not working.

 

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.
Now its working Fine. I have Used Below mentioned Query. var query ="priority.code=\"1\" and problem.status~=\"Closed\" and update.time < (tod()-'2 00:00:00')";

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.