Integration

kriti4
Tera Expert

When i am creating the ticket using rest integration . I am able to create the ticket in other service now instance but i am getting the  incident tickets are created  with all fields except two fields work notes & sub category .below is the code i have written .Please ley me know if any  modifications has to be done.

Script :

 try {
         var r = new sn_ws.RESTMessageV2('Servicenow 190293 to ServiceNow 191275', 'Insert Incident');
         r.setStringParameterNoEscape('caller_id', current.caller_id);
         r.setStringParameterNoEscape('description', current.description);
         r.setStringParameterNoEscape('category', current.category);
         r.setStringParameterNoEscape('subcategory', current.subcategory);
         r.setStringParameterNoEscape('short_description', current.short_description);
         r.setStringParameterNoEscape('state', current.state);
         r.setStringParameterNoEscape('priority', current.priority);
         r.setStringParameterNoEscape('work_notes', current.work_notes);
         var response = r.execute();
         var responseBody = response.getBody();
         var httpStatus = response.getStatusCode();
     } catch (ex) {
         var message = ex.message;
     }
4 REPLIES 4

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Have you verified that there's no business rule that prevents the subcategory? Or that you have the same category/subcategory structure between the instances and possibly its dependency with category?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

kriti4
Tera Expert

i will check for subcategory but what about work notes?

Have you verified if current.work_notes is correct? For example when executing this Async, current.work_notes will be empty.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

kriti4
Tera Expert

I have added the log into the  After BR

gs.info("Subcategory"+current.subcategory +"short description"+current.short_description+"Work Notes"+current.work_notes)
but i can't able to  get the worknote value.