Parent incident to be created for multiple child incidents on the click of a button.

Aritra Gupta1
Tera Contributor

Hi All,

I have a requirement to create a parent incident on the basis of child incidents selected in the incident table by clicking a button in the banner with many to one relation(i.e. for multiple incidents selected one parent incident to be created). For one to one it is working with this in UI action - 

var gr = new GlideRecord('incident');
gr.initialize();
gr.short_description = 'parent';
var id = gr.insert();
current.parent_incident =id;
current.update();

but I am not able to create for multiple. How can this be achieved??

Thanks in advance!!

1 ACCEPTED SOLUTION

Hello Aritra,

Happy to know that my solution has helped you. I have updated a few more things like a confirmation popup, & an alert if records are selected.

Please go through the below article.

UI ACTION to create a parent incident on the basis of selected records[act as child incidents] from ...

Mark it as helpful & correct, If Applicable

Cheers..!
Happy Learning:)
Tushar

Mark it as helpful or correct, If Applicable


Cheers..!

Happy Learning:)

Tushar

View solution in original post

7 REPLIES 7

eumak
Tera Guru

Hello Aritra Gupta,

You can check the below thread to get some help.

https://community.servicenow.com/community?id=community_question&sys_id=0572604ddba61f00fece0b55ca96...

Cheers..!
Happy Learning
Tushar 

Mark it as helpful or correct, If Applicable


Cheers..!

Happy Learning:)

Tushar

Hi Tushar,

Thank you for your reply.

Checked that already it's not working.

If there is any other way please let me know.

Regards,

Aritra

What's not working?

Can you share your configuration, not just the code?


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Hi Paul,

 

By following this link https://community.servicenow.com/community?id=community_question&sys_id=0572604ddba61f00fece0b55ca96...

 

I created a context menu and a script includefind_real_file.png

find_real_file.png

but post this the option is not getting visible anywhere. Even tried to give parent to the context menu record as "configure" still even there nothing new was added.

 

And for the code that I have mentioned it is working on one to one basis like for every child incident a parent is getting created and whereas I want one parent to be created for multiple child incidents.

Regards,

Aritra