
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 05:45 AM
Hi Experts,
On creating a child incident using the 'New' UI action in the incident related lists, I want the child to have some fields like Description, Short Description, etc copied from its parent record.
I see there an OOTB UI action, but not sure where to add my function in the existing script.
Some guidance would be appreciated.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 07:38 AM
Hi Allen,
I created only a display BR and updated the fields like below:
current.short_description = current.parent_incident.short_description;
current.category= current.parent_incident.category;
current.subcategory= current.parent_incident.subcategory;
current.business_service= current.parent_incident.business_service;
It worked that way.
Thanks a lot though! 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 08:26 AM
Hi
Sorry, I'm confused. That's what they said to do in the thread I linked for you and said myself. A display BR and use that post as an example on how to go about doing it.
So you're saying: thanks a lot though
??
Again, the post I linked you to literally covers that you'd create a Display Business Rule and gave sample code to use to pull the value from it's related parent and pre-fill those fields accordingly.
If you don't mind, if my reply was the post that helped guide you correctly.
Please mark my reply as Helpful & Correct. Currently, you marked your own post.
Thank you!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 08:36 AM
Hi Allen,
If you check the display BR posted in the link mentioned by you, it is using g_scratchpad object and an Onload client script as well. I did exactly as mentioned.
That method was working but only for the case when I would use the hamburger icon to create the incident, not the UI action.
For me, it simply worked without using scratchpad object and the client script. I mean, simply the display Br worked, and no scratchpad object was needed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 09:03 AM
Hello,
The post was about a display business rule. That was the answer, correct? Which is what the thread I pointed to was about. You don't have to use the scratchpad object and that thread isn't something you can copy 100%. The point was...a display business rule would help you accomplish your request, which you did not know and posted the question on the community forums for assistance. That has access to the current object. Which you can then utilize as you need.
If you look at my initial reply...I simply called out the "display business rule". Which I said:
Hi,
This would actually have to be handled on the new record itself, through using something like a display Business Rule. See this thread for explanation/example: https://community.servicenow.com/community?id=community_question&sys_id=0ae84f9edba1db444837f3231f96191c
It's fine though, haha. This is silly. Glad I helped you and guided you towards the correct answer.
Take care!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 09:48 AM
Hi,
Advising to use the display BR was certainly helpful, but the other thread was also the same question, hence I was following blindly that, and I am confused why it was not working for me.
The content of that thread was not working for me, despite the requirement being the same.
I am just making sure whoever refers to this post later in future and is new to the platform like me, they can follow the approach that best suits them. 🙂
Thanks a lot for your help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2020 11:55 AM
Hi,
It's fine. It is not easily apparent from your post that you're brand new. We don't know your skill level, right? So, the initial approach to helping people answer a question that I do...is to provide documentation or a thread which covers that. See if that helps and if they need more assistance, I'd love to talk about it.
You're right, the thread I posted includes the exact scenario you had, it is the same question. That's why I posted it 🙂 ...and it does work when clicking the "New" button. You're saying it doesn't. Perhaps you didn't set it up the same way, either way, it's fine, you have access to the current object in the display business rule. If you use a scratchpad object, that is the same thing, you'd just use a client script onLoad to call the scratchpad and set it to the field.
So in the business rule you could do (example):
g_scratchpad.name = current.parent.name;
The scratchpad brings along the value with it. Within a client script, you use it onLoad to say: hey scratchpad, what do you contain? And in that client script you'd say:
g_form.setValue('name', g_scratchpad.name);
And with that...it sets your name field to the scratchpad value that came with it. You can also tap directly in to the current object, which is what you did. That cuts out the middle-man of using the scratchpad allowing you to just immediately set your form to that. The problem is, this will happen for EVERY incident. It will attempt to set those fields directly to what is in your business rule script instead of using a scratchpad, unless you use conditions or set some other parameters around that. Using a scratchpad...let's you call the shots when you're ready.
Either way, what matters is what works for you and it gets you to the end result. The end result was to use a display business rule which has access to not only current...but scratchpad if you needed it.
Not everything may need to be done onLoad, right?
Say they selected another value for a select-box field AND THEN...you wanted something from the parent? Well, then the scratchpad could have brought that over, but not used it yet, then in an onChange client script, voila...when that child field is changed to 'x', you have that scratchpad with something from the parent to then set the field to and that is now ready to be used.
Anyways, again, I'm glad I helped guide you towards the correct answer. Any question that is asked on the forums could be self-answered by the author because ultimately the correct answer is what worked for them right? Not everyone else. So...with that logic, no one would be correct but the authors.
The point was, a display business rule gives you the tools. I'm glad you took my guidance and used it and it was Correct.
Now...with full explanation, they can choose which approach works for them. Because now they know both.
Take care!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!