We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Add 'Create Request' Option in Service Operation Workspace

Alon Grod
Tera Expert

How can I adjust this code and add an option 'Create Request', when the user will choose this option he will be redirect to the instance url (should be dynamic) + esc?id=sc_category, for example: https://servicenow/esc?id=sc_category

The user should have two options: 'Create Incident' (working fine) and 'Create Request').

Screenshot 2023-07-16 at 22.34.45.png

 

{
  "contextual": [
    "record",
    "kb_view"
  ],
  "newTabMenu": [
    {
      "label": {
        "translatable": true,
        "message": "New Incident"
      },
      "routeInfo": {
        "route": "record",
        "fields": {
          "table": "incident",
          "sysId": "-1"
        },
        "multiInstField": "sysId"
      },
      "condition": {
        "tableDescription": {
          "table": "incident",
          "canCreate": true
        }
      }
    }
  ],
  "maxMainTabLimit": 10,
  "maxTotalSubTabLimit": 30
}
5 REPLIES 5

Not applicable

Hello @Alon Grod 

 

 

 

{
  "contextual": [
    "record",
    "kb_view"
  ],
  "newTabMenu": [
    {
      "label": {
        "translatable": true,
        "message": "New Incident"
      },
"type":"navigation",
"position":200,
"primaryDisplay":"none",
"value":{
"type":"external",
"opensWindow":"true",
"value": {
"href": "/esc?id=sc_category"
}
},
      "routeInfo": {
        "route": "record",
        "fields": {
          "table": "incident",
          "sysId": "-1"
        },
        "multiInstField": "sysId"
      },
      "condition": {
        "tableDescription": {
          "table": "incident",
          "canCreate": true
        }
      }
    }
  ],
  "maxMainTabLimit": 10,
  "maxTotalSubTabLimit": 30
}

 

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

 

@Community Alums  its not working

Cau Thoong
Tera Contributor

Try adding this? This takes me directly to the service catalog page in SOW.

{
"label": {
"translatable": true,
"message": "New Request"
},
"routeInfo": {
"route": "record",
"fields": {
"table": "sc_cat_item",
"sysId": "-1"
},
"multiInstField": "sysId"
},
"condition": {
"tableDescription": {
"table": "sc_cat_item",
"canCreate": true
}
}
},

Sebas Di Loreto
Kilo Sage

@Cau Thoong 
That worked perfectly fine. Thank you!

Here is the extra code if you want to add roles to it

 

{
"label": {
"translatable": true,
"message": "New Request"
},
"routeInfo": {
"route": "record",
"fields": {
"table": "sc_cat_item",
"sysId": "-1"
},
"multiInstField": "sysid"
},
"condition": {
"tableDescription": {
"table": "sc_cat_item",
"canCreate": true
},
"roles": [
"sn_service_desk_agent", "itil"
]
}
},

If I helped you with your case, please click the Thumb Icon and mark as Correct.