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.

Need to exclude all the business applications from the CI field

Abigail
Tera Expert

javascript: current.sys_class_name == 'cmdb_ci_batch_job'? 'cmdb_ci.sys_id=cmdb_ci_batch_job.batch_job' : ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1? '' : 'operational_statusNOT IN' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join()

 

 

This is the recent code, any idea how to exclude the business application from the results?

1 ACCEPTED SOLUTION

Tushar
Kilo Sage
Kilo Sage

Hi @Abigail 

 

can you please try below -

 

current.sys_class_name == 'cmdb_ci_batch_job'
  ? 'cmdb_ci.sys_id=cmdb_ci_batch_job.batch_job'
  : (current.sys_class_name == 'business_application'
    ? ''
    : ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1
      ? ''
      : 'operational_status NOT IN ' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join())

 

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Regards,
Tushar

View solution in original post

1 REPLY 1

Tushar
Kilo Sage
Kilo Sage

Hi @Abigail 

 

can you please try below -

 

current.sys_class_name == 'cmdb_ci_batch_job'
  ? 'cmdb_ci.sys_id=cmdb_ci_batch_job.batch_job'
  : (current.sys_class_name == 'business_application'
    ? ''
    : ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1
      ? ''
      : 'operational_status NOT IN ' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join())

 

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Regards,
Tushar