Wednesday, August 24, 2016

How to migrate Update Sets from One Instance to Other Instance in Service Now?


What is Update Set ?

An update set is a group of customizations that can be moved from one instance to another. For example, a set of enhancements to incident management can be grouped in an update set called Incident Management 2.0. While Incident Management 2.0 is marked as the current update set, all changes are tracked in it.

How to migrate Update Sets from One instance to other instance?

Approach 1

- Search for 'Local Update Sets'

- Click on 'New', Enter all the required info , click on 'Submit and Make Current'

- Make all the changes

- If you happen to switch to different update set and make some other changes on other update set, you can always switch to different update set by clicking on 'Gear' symbol on top right hand corner of your service now instance

                  - Click on 'Developer'
                  - Choose the 'Update Set' which you want to switch


 - Once all your changes done on your Update Set, You have to move this to other Service Now Instance (Target instance )

- Click on your Update Set from 'Local Update Set' module
- Modify the state to 'Completed'

- Click on 'Export to XML' and save to your preferred Location

- Login to Target Service Now Instance where you want to copy Update Set transactions

- Click on 'Retrieved Update Sets'

-  Click on 'Import Update Set from XML' link on bottom of all 'Retrieved Update Set' results.

- Select the 'Update Set XML' which you have stored on your preferred location and click on 'Upload'

- Click on your Update Set from 'Retrieved Update Sets' after completing above step, then click on 'Run Preview' button, verify all the errors and after resolving any errors found, click on 'Update and Commit'

- This will copy all your customizations in update set to Target Service Now Instance

Approach 2

- Go to Source Service Now Instance

- Click on 'Update Sources' module

- Select the Target Service Now Instance , If you can't find, then create

- click on 'Retrieve Completed Update Set's

- This will transfer all the 'completed' update sets into target instance.




How to retrieve Requester associated Director email in Service Now ?


This blog explains about how to retrieve any requester associated director email Address.

Scenario : Need to assign a specific request to requester associated director for approval

- Below method recursively calls until it finds the 'Director' role for a specific user

var answer=[];  
answer.push(findDirector(current.variables.u_requester.toString()));  //pass the sys_id of user 
function findDirector(id){  
var gr= new GlideRecord("sys_user");  
gr.get(id);  
if(gr.title.indexOf("Director")>-1){    
return gr.getValue('sys_id');  
}  
else{  
return findDirector(gr.getValue("manager"));  
}  

}  

Wednesday, August 17, 2016

How to test script using Background Script feature in Service Now

This blog explain about most commonly and most used technique to test any script in Service Now.

It is very common to verify any script before we implement, Service Now provides a feature called 'Background Scripts' through which you can verify any script

- Choose 'Elevate Roles' by clicking on drop down list side by your name on top right hand side.
- Select 'security_admin' check box
- Click on 'Ok'
- Search for 'Background' on applications list
- Write your own script and test accordingly as shown in below screenshot



Tuesday, August 16, 2016

Service Now & Microsoft SCCM Integration


This blog illustrates my experiences, challenges with Microsoft SCCM Integration.



 - First and far most important to know what kind of SCCM software being used at your customer location, Based on that version, Activate the corresponding plug-in in your Service Now Instance.



- I strongly prefer to have two Mid Servers configured for PROD Environment. Setup Mid Server and make sure Mid Server(s) up and running without any errors. Make sure verify the Log files of the Mid Server once started up and running. Goto Services on where Mid servers are installed, Verify the status of the Mid Server as shown below


- Get one dedicated User who has the access to SCCM
- Right click on Mid Server -> Properties
- Log On Section, Configure the dedicated user who has the access to SCCM and enter the Password and User Name. Make sure if you have two mid servers , need to repeat this step for each MID Server



- After successful plugin activation, You should able to see 'Integration - Microsoft SCCM..' on your applications list navigator as shown below
- Click on 'Setup'


- Enter all the required info in 'Integration Setup' form, Select the Mid Server and make sure MID Server is up and running. Save the form
- Next step is to configure all the required Data Sources for your SCCM Integration.
- Click on 'Data Sources' in 'Integration - Microsoft SCCM..' application
- Out of box, SCCM stores Servers and Workstations in different databases. Out of box we get all the data sources, so Create extra data source for each already existing data source and Suffix with ' - Server' and provide the correct Database Server Name and Database Name for all the 'Server' related data sources.

- Update all out of box Data sources with correct 'Database Server Name' and 'Database Name'
   Select 'Use Integrated Authencation' check box, so that it will use Mid Server to communicate with SCCM Database. Make sure to fill all the below highlighted required information for each data source

- After entering all the required information for each Data Source, verify 'Load All Records'  and execute 'Run Transform'
- I have very bad experience with 'Test Load 20 Records' , this won't work as expected all times, so don't relay on this functionality always.
- After first load of data, Select 'Use Last Run Datetime' check box on each data source, so that it won't load everytime same data into CMDB, only delta data for subsequent runs

- After configuring all the data sources, and verifying all the data sources working fine and loading data into CMDB, Next step is to configure 'Scheduled Import

- Click on 'Scheduled Import' in 'Integration - Microsoft SCCM..' application
- Choose the 'SCCM 2012 v2 Computer Identity' as your parent data source, and select appropriate value for 'Run' field
- Choose all the subsequent data sources which need to be run after Parent data source under 'Run the following imports when complete' section and give correct 'order' for each data source.

With this your SCCM configuration and schedule completed successfully and all good to go.




How to invoke Script Include by clicking on Pickup List? Or How to use Reference Qualifier in Service Now

This blog explains about how to invoke 'Script Include' by clicking on any 'Pickup List'

Use case : Display all the 'Configuration Items' based on selected value for 'Reported By' field on Incident form.




- Go to 'Script Includes'  in 'Applications Navigator'
- Create New, Give proper name and write the logic whatever you want in your script


- Go to 'Create new Incident' form
- Right click on 'Configuration Item' label, choose 'Configure Dictionary'
- Go to 'Reference Specification' tab
- Select 'Advanced' for 'Use Reference Qualifier' list of values
- Provide correct value for 'Reference qual'



- Now, Verify the functionality , Select value for 'Reported By' and click on 'Configuration Item' pickup list, you should see only configuration items associated to 'Reported By' selected value.