Why can't we copy stories in completed state OOB?

Pelayo
Tera Expert

There exists an OOB UI Action that lets users copy a story, but when the story moves to a Cancelled or Complete state, this UI Action disappears.

I've located where this is done, but now I have two questions.

 

1- What's the reason for this? I can't fully see the risks of copying stories in a completed state.

2- The UI Action Condition calls a read-only Script Include where this check is performed. If I were to change this, would it be best practice to clone the Script Inlcude and change the call from the UI Action Condition field to my newly cloned Script Include?

 

Thanks all!

 

Attached the code that performs this check, in SAFeStoryAbstract Script Include:

 

 

showActionOnSAFeStory: function(current) {
        var statesUtil = new global.ScrumStatesUtil(current.getValue('sys_class_name'));
        var isCancelledOrCompletedState = statesUtil.isCancelledOrCompletedState(current.getValue('state'));
        var isWrapperStory = current.isValidField('original_task') &&
            current.original_task.sys_class_name.toString() !== 'sn_safe_story';

        return (!isCancelledOrCompletedState) && (current.getValue('sys_class_name') === 'sn_safe_story') &&
            current.canCreate() && !isWrapperStory;
    },

 

 

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

Hi @Pelayo 

 

when ServiceNow builds functionality into the platform, they have a certain set of industry standards in mind they want to follow. But as always, this doesn't mean it is applicable for each and every customer. And the reason why we love ServiceNow is that we can customize OOTB functionalities or build or own.

In your case I would recommend (and this is also the official ServiceNow recommendation) to customize the OOTB UI Action by replacing the condition with your own condition. You could implement your own Script Include to place such a similar but modified version of the "showActionSAFeStory" method in there and use it accordingly in the customized UI Action.

 

Maik

View solution in original post

2 REPLIES 2

Maik Skoddow
Tera Patron
Tera Patron

Hi @Pelayo 

 

when ServiceNow builds functionality into the platform, they have a certain set of industry standards in mind they want to follow. But as always, this doesn't mean it is applicable for each and every customer. And the reason why we love ServiceNow is that we can customize OOTB functionalities or build or own.

In your case I would recommend (and this is also the official ServiceNow recommendation) to customize the OOTB UI Action by replacing the condition with your own condition. You could implement your own Script Include to place such a similar but modified version of the "showActionSAFeStory" method in there and use it accordingly in the customized UI Action.

 

Maik

Thanks Maik, that is along the lines of what I thought