
- 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 08:13 AM
Hi Tony,
This part has be a bit confused.
How can I adjust to code to ensure a the new story also gets added as a related link in the incident in question?
Did you mean a related list entry to associate the story with the current incident? A related link is a place for UI actions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2017 08:31 AM
Sorry for the confusion
On an individual incident I added an option "create story" to the hamburger menu, the code I posted executes when this option is selected and the story is successfully created.
The option to add a story appears in the related links section of an incident which is good, but I would also like any story that gets created via the link in the hamburger menu to appear in the related links section for the incident in question.
I tried Kalai suggestion but that does not appear to work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2017 08:36 AM
Hi Tony,
A screenshot would be most helpful here for what you are trying to accomplish. I'm not quite understanding and it may be semantics at this point.
As noted before Related links are a listing of Form Link UI Actions. It's not a place to list records related to the current incident (or any other record.) Those would be listed in a Related List (tables at the bottom of the form.)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2017 11:11 AM