Duplicate a case

Gayathri Moort1
Kilo Contributor

I am new to ServiceNow  and CSM

Can anyone help me to duplicate a case using UI actions... 

This needs a customization.. 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Gayathri,

you can use custom server side UI action for this

Sample script below; you should set the fields on new case as per your requirement

I have copied short description and assignment group

var gr = new GlideRecord('sn_customerservice_case');

gr.initialize();

gr.short_description = current.short_description;

gr.assignment_group = current.assignment_group;

gr.insert();

Mark as Correct Answer & Helpful if this solves your issue or Helpful if this is useful to you.
Regards
Ankur

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Indrajit
Mega Guru

Hey Gayathri,

You can refer below links for making copy of record using UI actions,

https://www.servicenowguru.com/system-ui/ui-actions-system-ui/copy-ui-action-change-requests/

https://www.servicenowguru.com/system-ui/ui-actions-system-ui/copy-ui-action-change-requests-part-2/

https://hi.service-now.com/kb_view.do?sysparm_article=KB0817494

https://www.youtube.com/watch?v=VCRv0pRaMwg

 

kindly mark Correct and Helpful if applicable.

Regards,

Indrajit.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Gayathri,

you can use custom server side UI action for this

Sample script below; you should set the fields on new case as per your requirement

I have copied short description and assignment group

var gr = new GlideRecord('sn_customerservice_case');

gr.initialize();

gr.short_description = current.short_description;

gr.assignment_group = current.assignment_group;

gr.insert();

Mark as Correct Answer & Helpful if this solves your issue or Helpful if this is useful to you.
Regards
Ankur

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar Hi, this was helpful. How would we copy attachments from one case to another in same configurations, when creating this copy case ui action.

Ankur Bawiskar
Tera Patron
Tera Patron

@Gayathri Moorthy 

Let me know if that answered your question.

If you find my response solved your issue, please mark answer as Correct & Helpful to help others with the same response find the answer more quickly.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader