- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 03:44 AM - edited 11-22-2023 03:46 AM
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;
},
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 07:47 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 07:47 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 07:52 AM
Thanks Maik, that is along the lines of what I thought