Skip to main content

Posts

Showing posts from October, 2020

Modify the preview fields on reference field - pull in class field ("i" icon)

Modify the preview fields on reference field - pull in class field ("i" icon)   configuration item field> go to the classes by their table https:/<>.service-now.com/cmdb_ci_win_server.do? sysparm_view=sys_popup edit the form to pull in the desired fields, e.g. class (class maybe not the best example as this displays at the top of the popup but illustrates the point!) sys user>  https:/<>.service-now.com/sys_user.do? sysparm_view=sys_popup

cmdb_ci field: change auto complete to include serial_number, asset_tag

 cmdb_ci field: change auto complete to include serial_number, asset_tag /sys_schema_attribute_m2m_list.do?sysparm_query=schema%3D2207a8941b30101059de620e6e4bcb90&sysparm_view=advanced&sysparm_first_row=1

configuration item filter: pull back list of CI sys ids linked to service offering field

 further to my previous post regarding applying a filter to the configuration item field (e.g. on incident), following will retrieve a list of the following business service to child relationships (highlighted seems necessary so as not to pack the array with the same array multiple times!) if ( sCI_filter == 'linked to service offering' && ! gs . nil ( current . service_offering )) { var sSOquery = '^parent.sys_class_name=service_offering^parent=' + current . service_offering ; var sRelType = '55c95bf6c0a8010e0118ec7056ebc54d' ; //--Contains::Contained by var sSYSIDs = this . _u_getCMDBrelCI_CIs ( sSOquery , sRelType ); configItemFilter += '^sys_idIN' ; configItemFilter += sSYSIDs ; //gs.log(sSYSIDs,'TaskUtilsSNC:getConfigurationItemFilter'); } _u_getCMDBrelCI_CIs : function ( relationshipQuery , relType ){ var sysIds =[]; var grRelCI ...

Apply a filter on the configuration item on inc/prb/chg forms

 create a custom field on the TASK table and pull it into the incident form then, make a copy of the TaskUtilsSNC script include, and update the dictionary overrides to reference that. Alter the new script include to pick up the parameter from the new field if an option is selected

Date manipulation: trigger a task based on staff end date entered in RITM

 - if the end date on the staff leavers service request < todays date, set zero seconds - if the end date is today, set number of seconds as today date/time up to today at 18:00 - if the end date is future, set the wait time in seconds as end date at 18:00 scratchpad will then be passed to a wait until block in the workflow ============= script: //--see STRY0010592 for background var bDateInPast = false ; //---SET SCRATCHPAD--TIMER 1----------------------------- workflow . scratchpad . ritmtimetowait = 0 ; //--value in seconds var sNumL = current . number + ': ' ; //--get the predetermined TIME to trigger the task********************* var sTimeToTrigger_prop = gs . getProperty ( 'he.ritm.leaverenddate.timetotrigger' ); //normally set to 18:00, (can be set to lower in test environments) var gtTriggerTime = new GlideTime (); gtTriggerTime . setValue ( sTimeToTrigger_prop ); //gs.log(sNumL + gt.getByFormat("HH:mm"), 'wf:StaffLeaver...