Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Custom Option to "Create Article" in Workspace broken since Zurich

Julia Baus
Kilo Guru

We have added the option to create articles in our workspace in the header tab:

JuliaBaus_0-1763456836684.png

We did this by extending the following json: sys_ux_page_property.do?sys_id=1bba870c0ff120102208555db4767e71

We added the following to the value:

{
"label": {
"translatable": true,
"message": "Create Article"
},
"routeInfo": {
"route": "kb_template_selector_modal",
"fields": {
"sysId": "-1"
},
"multiInstField": "sysId"
},
"condition": {
"tableDescription": {
"table": "kb_knowledge",
"canCreate": true
}
}
}

It worked fine until the Zurich release where it seems the route for kb_template_selector_modal was changed to {{table}} instead of {{sysId}} like e.g. for interaction (which uses the same json):

JuliaBaus_1-1763457142689.png

We already tried to update the json, but couldn't find the proper format for the new call.

 

Anyone who has done something similar and knows how to update the route correctly?

 

2 REPLIES 2

Sarthak Kashyap
Mega Sage

Hi @Julia Baus ,

 

I tried your problem in my PDI and it works for me please check below steps 

Please navigate to sys_ux_page_registry table and open "Service Operation Workspace" record and in related list search for chrome_tab 

SarthakKashyap_0-1763458673022.png

 

 

Add below JSON

{
  "contextual": [
    "record",
    "kb_view"
  ],
  "newTabMenu": [
    {
      "label": {
        "translatable": true,
        "message": "New Interaction"
      },
      "routeInfo": {
        "route": "record",
        "fields": {
          "table": "interaction",
          "sysId": "-1"
        },
        "multiInstField": "sysId"
      },
      "condition": {
        "tableDescription": {
          "table": "interaction",
          "canCreate": true
        }
      }
    },
    { // Here is your Article JSON Start
      "label": {
        "translatable": true,
        "message": "Create Article"
      },
      "routeInfo": {
        "route": "kb_template_selector_modal",
        "fields": {
          "sysId": "-1"
        },
        "multiInstField": "sysId"
      },
      "condition": {
        "tableDescription": {
          "table": "kb_knowledge",
          "canCreate": true
        }
      }
    }, // // Here is your Article JSON End
    {
      "label": {
        "translatable": true,
        "message": "New Incident"
      },
      "routeInfo": {
        "route": "record",
        "fields": {
          "table": "incident",
          "sysId": "-1"
        },
        "multiInstField": "sysId"
      },
      "condition": {
        "tableDescription": {
          "table": "incident",
          "canCreate": true
        },
        "roles": [
          "sn_incident_write",
          "itil"
        ]
      }
    },
    {
      "label": {
        "translatable": true,
        "message": "New Change Request"
      },
      "routeInfo": {
        "route": "create-change-request-page",
        "fields": {},
        "multiInstField": ""
      },
      "condition": {
        "tableDescription": {
          "table": "change_request",
          "canCreate": true
        }
      }
    },
    {
      "label": {
        "translatable": true,
        "message": "New Problem"
      },
      "routeInfo": {
        "route": "record",
        "fields": {
          "table": "problem",
          "sysId": "-1"
        },
        "multiInstField": ""
      },
      "condition": {
        "tableDescription": {
          "table": "problem",
          "canCreate": true
        }
      }
    }
  ],
  "maxMainTabLimit": 10,
  "maxTotalSubTabLimit": 30
}

 

Result

SarthakKashyap_1-1763458767606.png

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards,

Sarthak

 

 

If you check my post, you can see that it is exactly what we already have. It opens the page but with URL /now/hr/agent/kb_template_selector_modal/~~undefined~~ and if you select KB and template then and click "Create" the redirect does not work properly due to the "undefined" part. 

 

It worked fine before Zurich, but not anymore and thus I was asking for a fix