Options to generate a delimited text file from an incident with the filed values captured in it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 08:25 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 09:50 AM
Are there any conditions under which that action should be disabled, such as if the resulting file would be missing a required value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 12:22 PM
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);