Incident

P1234
Tera Contributor

I attended the interview today interviewer ask one question like

 

Problem Record A : 20 records

Problem Record B : 10 records

Incident : INC00000(Reference field) (When incident is created)

Short-Description : Text

Description : Text

 

1.When the user select problem Record A only print 20 records along with short description , description.

2.Same as user select problem Record B only print 10 records along with short description , description.

1 ACCEPTED SOLUTION

@P1234 

your question is not clear.

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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@P1234 

so what did you answer?

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

Hi Ankur,

 

var problemSysId = current.problem_id;

var gr = new GlideRecord('incident'); 
gr.addQuery('problem_id', problemSysId);
gr.setLimit(20);
gr.query();

while (gr.next()) {
gs.print('Incident Number: ' + gr.number + ' | Short Description: ' + gr.short_description);
}

 

But i don't know where i can mistake if any idea please let me know Ankur

@P1234 

your question is not clear.

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

Hi Ankur,

 

Question : When the user select problem Record A only print 20 records along with short description , description.