The Zurich release has arrived! Interested in new features and functionalities? Click here for more

I want to create problem by copying existing record.

shun6
Giga Sage

Hi all,

I want to create problem by copying existing record.

I know incident record can copy by clicking header and select 'Copy Incident'.

Is it possible to do the same thing at problem table?

Thanks.

find_real_file.png

1 ACCEPTED SOLUTION

Harish KM
Kilo Patron
Kilo Patron

Hi you can use script in UI Action like this

var prb = new GlideRecord('problem');
prb.initialize();
prb.short_description = current.short_description; // copy short description
prb.description = current.description;// copy description
prb.assigned_to = current.assigned_to; // copy assigned to
prb.assignment_group = current.assigned_group; //copy group
var SYSID = current.insert(); // this will create a new problem record 

Regards
Harish

View solution in original post

4 REPLIES 4

Chandu Telu
Tera Guru
Tera Guru

Hi Shun,

 

You can use the same code from copy incident and create Custom UI Action in Problem table. Check the below will provide more information

https://community.servicenow.com/community?id=community_question&sys_id=2bc5e2aadb539f000be6a345ca9619a5

 

Thanks
Chandu Telu
Please Mark ✅ Correct/helpful, if applicable,

HI shun

Follow Up - is your requirement is completed with my answer. Please mark answer as correct it will use for other community members if not let us know your issue so we can help you 

Thanks
Chandu Telu
Please Mark ✅ Correct/helpful, if applicable,

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Shun

Check "Copy Incident" script. It's calling Script Include "IncidentUtils2" which calls "IncidentUtils2SNC". Adding "Copy Problem" probably can be done but it doesn't look too simple.

  1. Go to "System Definition" > "UI Action".
  2. Filter on "Name", "Copy Incident"

Harish KM
Kilo Patron
Kilo Patron

Hi you can use script in UI Action like this

var prb = new GlideRecord('problem');
prb.initialize();
prb.short_description = current.short_description; // copy short description
prb.description = current.description;// copy description
prb.assigned_to = current.assigned_to; // copy assigned to
prb.assignment_group = current.assigned_group; //copy group
var SYSID = current.insert(); // this will create a new problem record 

Regards
Harish