How to display a message when an Incident is a Parent or Child?

Kevin Parker
Tera Expert

Howdo,

I have what I thought was a simple task and appears to have turned out to be anything but! I want to display a message at the top of an Incident record to warn people if it is a Child or a Parent (or possibly both!)

The child message is easy as I can use a business rule to check the Parent field. What I can't work out is how to display the message if the Incident has any Child Incidents linked to it. I am not that familiar with Javascript but have scoured the community for anything that would help without success. Does anyone have anything in place that I can borrow? Please feel free to tell me there is something OOTB that I have missed?

Thanks in advance.

Kevin

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

See the screenshots below! Tested this on my personal developer instance, works instantly.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

View solution in original post

5 REPLIES 5

Mark Roethof
Tera Patron
Tera Patron

Hi there,

See the screenshots below! Tested this on my personal developer instance, works instantly.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

Hi Mark,

Thanks for this, it looked like it would do the trick but I have since realise that the field we record the Parent Incident number is not actually the parent_incident field from the Incident table, it is the Parent field from the Task table! How would you change the script to reference this field instead?!

I am not sure why our consultants set it up this way? I thought I could try and copy the value between fields but killed my NonProd instance doing so!

Kevin

Hi there,

Theoretically, you could also just check the parent field. So instead parent_incident, just use parent. Do check your data, check what the value is on the parent field for all your incidents. I'm mentioning this, because theoretically, you could also have other tickets als parent, not just incidents.

If in your case, only incidents: just go for the parent field. Parent is also available on incident (because it's extended), so no tricks needed. Just replace parent_incident in the BR suggested, with parent.

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

Thanks Mark, I was being a spanner and forgot that was the case!

Works a treat, many thanks for your help.

Kevin