Copy whole content of activity formatter from Incident to Change request in UI16 (Geneva)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2016 02:28 AM
Hi all,
I would like to ask, if someone from you have already experience with copying of whole content of Activity log from on ticket type to another.
On the Incident I am running UI action, which created the change request from Incident (Convert to Change request UI Action).
What the customer would like to see in the Activity log inside the new created Change request is the same content of Activity log as it is in the Incident, from which was change request created.
With all of the content of Activity log I mean: work notes, additional comments, attached pictures every information about "Email sent" or "Email recieved" generated by the system, changed from the users regarding state, resolve notes and so on .... All of this information from Incident I would like to see inside the Activity log in my Change request.
I am working with Geneva release (UI16).
Do you have any idea how can I copy whole content?
Thank you for any suggestion!
Regards,
Veronika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2016 08:47 AM
HI Veronika, were you able to get this working? I am looking to do this too.
Thanks,
Laura
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2016 08:14 AM
Hi Veronika
For copying whole activity from one table to another table , we can query like getJournalentry(-1)
Please try this below script . might be work for you
Here below I copied work notes from inc to change with same serial number record
var grCI = new GlideRecord('u_incident');
grCI.query();
if (grCI.next()){
var gr = new GlideRecord('u_change_request);
gr.addQuery('serial_number','Test 1');
gr.query();
if(gr.next())
{
gr.u_work_notes=grCI.u_work_notes.getJournalEntry(-1);
gs.log("Hello"+grCI.u_work_notes);
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2021 10:42 PM
Can anyone help me out to copy the original email activity from an Incident to a request using the UI action. I'm unable to find out what is the field name of the activity field to mention in the script.
Below is my script. I've highlighted the notes field as I feel its here that the activity field name should be entered. Now my goal is to populate the email activity either into the description box in the request table or just show it how it is visible in the Incident form in the activity formatter.
var reqs = new GlideRecord("u_requests");
reqs.short_description = current.short_description;
reqs.priority = current.priority;
var answer = ' ';
var notes = current.work_notes.getJournalEntry(-1); //gets all journal entries as a string where each entry is delimited by '\n\n'
var na = notes.split("\n\n"); //stores each entry into an array of strings
for (var i = 0; i < na.length; i++)
answer = na[i] + "\n" + answer;
reqs.description = answer;
//gs.addInfoMessage(reqs.work_notes);
gs.addInfoMessage(answer);
var sysID = reqs.insert();
current.parent = sysID;
var mySysID = current.update();
gs.addInfoMessage(gs.getMessage("Requests {0} created",reqs.number));
action.setRedirectURL(reqs);
action.setReturnURL(current);