How to print latest 5 incidents from incident table

Srinivas91
Giga Contributor

How to print latest 5 incidents from incident table

3 REPLIES 3

Elijah Aromola
Mega Sage

Can you provide more information about this requirement? What do you mean by print? 

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Can you try to expand your questions a bit more? Providing more information, what you are really after? What you perhaps already did yourself?

 

Same as your previous questions. Which also was a one-liner with same title and description: "What is Incident?"

 

Posting questions like this, we can't really help you correctly. Or we are spending time and effort, while you are actually after something completely different.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Community Alums
Not applicable

Hi Srinivas,

 

Here is the script.

 

var inc = new GlideRecord("incident");

inc.setLimit(5);

inc.orderByDesc("sys_created_on");

inc.query();

while(inc.next())

{

    gs.info(inc.number);

}