Options to generate a delimited text file from an incident with the filed values captured in it

Shaji T M
Tera Contributor

Greetings!

Looking for options to generate a delimited text file from an incident or any other records with, the filed values captured in it. Also, the file should be added as an attachment in the record.

The text file should contain the values as below:

Number : INC000121

Caller: XYX

Configuration Item : ABC

Category: Application

Short Description: test

Assignment Group : Service Desk

Assignee: Test User

 

 

Thank you 

 

 

6 REPLIES 6

Are there any conditions under which that action should be disabled, such as if the resulting file would be missing a required value?

thomaskennedy
Tera Guru

This example UI Action generates a json file and sends it as a download.

It does not delete any existing attachment by that name.

It does not check that the attachment was created successfully.

 

 

 

var data = {
    "foo":"baz"
};
var gsa = new GlideSysAttachment();
var att_sys_id = gsa.write(current, 'data.json', 'text/json', JSON.stringify(data));
gs.setRedirect('/sys_attachment.do?sys_id=' + att_sys_id);