Workspace Save button not working when Assignment Group is changed

mania
Tera Contributor

Hi Team,

I’m facing an issue with the Save button in Service Operation Workspace related to the OOB Declarative Action genai_save_assign_direct.

mania_0-1787048446664.png

Script Condition:

!current.isNewRecord() &&
current.canWrite() &&
new sn_itsm_gen_ai.NowAssistItsmGenAIUtilsSNC().showAssignModal(current)

OOB Scripted Client Condition:

("{{fields.assigned_to.value}}" == "{{fields.assigned_to.originalValue}}" || "{{fields.assigned_to.value}}" == '') &&
("{{fields.assignment_group.value}}" == "{{fields.assignment_group.originalValue}}" || "{{fields.assignment_group.value}}" == '')

Issue

When I open an existing incident record and change the Assignment Group from one group to another, the Save button does not work as expected.

The OOB condition evaluates to false because the Assignment Group value is different from its original value.

I also tested changing the && to ||:

("{{fields.assigned_to.value}}" == "{{fields.assigned_to.originalValue}}" || "{{fields.assigned_to.value}}" == '') ||
("{{fields.assignment_group.value}}" == "{{fields.assignment_group.originalValue}}" || "{{fields.assignment_group.value}}" == '')

With this change, when I modify the Assignment Group, another Save (duplicates) button appears. If I click the newly displayed Save button, the Assignment Group is saved successfully, but after saving, that Save button disappears and the previous Save button is shown again.

I have only one sys_declarative_action_assignment record for genai_save_assign_direct.

I also checked the showAssignModal(current) method:

showAssignModal: function(current) {
    if (!this.userCanExecuteInProductSkill(
        this.ASSIGN_CONFIG.CAPABILITY_ID,
        current.getTableName(),
        current.getUniqueValue()
    ))
        return false;

    var nowAssistSkillConfig = new sn_nowassist_admin.NowAssistSkillConfig();

    var skillConfig =
        nowAssistSkillConfig.getSkillConfigurationWithBaseTableFallback(
            this.ASSIGN_CONFIG.CAPABILITY_ID,
            {
                table: current.getTableName()
            },
            true,
            current
        );

    var variableSets =
        skillConfig && skillConfig.variable_sets
            ? skillConfig.variable_sets
            : [];

    for (var i = 0; i < variableSets.length; i++) {
        if (this.isDefineTriggerConfigType(variableSets[i]))
            return variableSets[i].props.assign_modal_enabled === "true";
    }

    return false;
}

From what I understand, showAssignModal() is checking whether the Now Assist assignment modal is enabled, rather than whether the Assignment Group has changed.

My requirement is:

When the Assignment Group is changed from one group to another, I want the Save button to save the Assignment Group change normally, without displaying two Save buttons or requiring a second Save action.

 

Could someone please explain which OOB Declarative Action/condition is supposed to handle the Assignment Group change and why the Save action is not working when the Assignment Group is modified?

Any guidance on the correct OOB configuration or recommended approach would be appreciated.

Thanks!

1 REPLY 1

Ankur Bawiskar
Tera Patron

@mania 

you will have to compare this against another instance where this is working and then identify the difference

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader