
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2017 08:10 AM
I created a UI action that allows for the ability add a story from an individual incident the code is as follows
var story = new GlideRecord("rm_story");
story.short_description = current.number + " - " + current.short_description;
story.description = current.short_description;
var sysID = story.insert();
action.setRedirectURL(story);
action.setReturnURL(current)
How can I adjust to code to ensure a the new story also gets added as a related link in the incident in question?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2017 08:15 AM
var story = new GlideRecord("rm_story");
story.short_description = current.number + " - " + current.short_description;
story.description = current.short_description;
story.parent=current.sys_id;
var sysID = story.insert();
action.setRedirectURL(story);
action.setReturnURL(current)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2017 11:16 AM
If the story is getting created without any issues, then adding the single line change stated above should work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2017 12:04 PM
Kalai,
You are correct thank you. For some reason this doesn't work in my own personal instance from the developer site, but it works when I tried it in my own companies dev environment, thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2017 10:05 AM
Do you mean that you'd like to see these related stories to appear against the incident, much like child incidents, related problems, changes, etc?
Do you have a field in your [rm_story] table that relates to the incident?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2017 08:15 AM
var story = new GlideRecord("rm_story");
story.short_description = current.number + " - " + current.short_description;
story.description = current.short_description;
story.parent=current.sys_id;
var sysID = story.insert();
action.setRedirectURL(story);
action.setReturnURL(current)