I'm trying to allow user to be able to add attachments to Stories created from an Enhancement

Hola Ola
Giga Guru

Hello everyone, 

I have a slightly confusing situation here. 

When I open a NEW Story record (rm_story), I'm able to fill out the form and add attachment to it, then submit it.

find_real_file.png

However, when I go into and existing Enhancement to create a NEW Story, I don't get the option of adding attachment;

find_real_file.png

Here's the only Active UI Action that I found, or that i think may be connecting the two issues. 

find_real_file.png

function openFormDialog() {
    var sysId;
    if (typeof rowSysId == 'undefined')
        sysId = gel('sys_uniqueValue').value;
    else
        sysId = rowSysId;
    var gModalForm = new GlideModalForm('Create Story', 'rm_story');
    gModalForm.setPreference('sysparm_view', 'scrum');
    gModalForm.addParm('sysparm_query', 'short_description=' +
        g_form.getValue('short_description').replace(/\^/g, '^^') +
        '^description=' + g_form.getValue('description').replace(/\^/g, '^^') +
               //'^assigned_to=' + g_form.getValue('assigned_to') + commented so that Assigned to isn't copied//
        '^classification=Feature' +
        '^enhancement=' + sysId +
        '^sys_class_name=rm_story'
    );
    gModalForm.setCompletionCallback(function(action_verb, sys_id, table, displayValue) {
        if (action_verb == 'sysverb_insert') {
            if (typeof GlideList2 !== 'undefined') {
                if (GlideList2.get("rm_enhancement.rm_story.enhancement"))
                    GlideList2.get("rm_enhancement.rm_story.enhancement").refresh();
            }
        }
    });
    gModalForm.render();
}

 

Where am I getting it wrong or missing?

1 ACCEPTED SOLUTION

Harneet Sital
Mega Sage
Mega Sage

Hi Hola Ola, 

This is the way it works OOTB, we do not have attachment icon available on the modal popup that comes up when you click create story from enhanacement. You can do two things here -

1. Once the story is submitted/saved, add the attachment manually, the record is available in the related list. 

2. If the attachment you need to attach is the same on the enhancement then simply copy it to the target record. Create an insert BR, which checks for the enhancement and copies the attachment to the story automatically. 

 


Thanks
-Harneet Sital (ServiceNow Certified Technical Architect)
Request you to please mark my answer as helpful or correct based on the impact

Find all my ServiceNow articles here

View solution in original post

2 REPLIES 2

Harneet Sital
Mega Sage
Mega Sage

Hi Hola Ola, 

This is the way it works OOTB, we do not have attachment icon available on the modal popup that comes up when you click create story from enhanacement. You can do two things here -

1. Once the story is submitted/saved, add the attachment manually, the record is available in the related list. 

2. If the attachment you need to attach is the same on the enhancement then simply copy it to the target record. Create an insert BR, which checks for the enhancement and copies the attachment to the story automatically. 

 


Thanks
-Harneet Sital (ServiceNow Certified Technical Architect)
Request you to please mark my answer as helpful or correct based on the impact

Find all my ServiceNow articles here

andreashamre
Tera Contributor

Hi,

you can set the parameter "titleless" to false like this:

myModalForm.setPreference("sysparm_titleless", "false");

 See for more info: 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0868327