How to create story from Incident form as create story is an UI action on Incident form

User13807
Tera Contributor

Hello Team,

 

I have a requirement to create a story by clicking on UI action called create story on incident form and that story form should be opened in new tab not on same page how can I achieve this requirement?

3 REPLIES 3

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

There is a solution available for this. Did you check link

If you are stuck somewhere, help elaborate details.

User13807
Tera Contributor

Thank you for your response but I read somewhere that, this requirement will be completed by Script Include and Ajax to open story form on new page.

priyasunku
Kilo Sage

Hi @User13807 

 

you can try below code

 

var newStory = new GlideRecord("rm_story");
newStory.initialize(); 
newStory.short_description = current.short_description;
newStory.description = current.description; 
newStory.state = 6; //draft
newStory.opened_by = gs.getUserID(); //Story opened by will be whoever clicked UI action
newStory.insert(); 
action.setRedirectURL(newStory);

 

 If my answer solved your issue, please mark my answer as Correct & 👍Helpful