Auto populating configuration item in service catalogue item

carlm1984
Mega Contributor

Hello All,

I believe I am trying to do something fairly simple but as I am new to ServiceNow I am getting myself in a tangle here.

So in my Requested Item I have a field called '' I would like to auto populate this from when a user completes a Catalogue Item.

What I am wondering is how I add this field onto my 'Maintain Item' on the service catalogue and get it to auto populate in the requested item??

Any guidance I will be very greatful for.

Kind Regards

Carl

9 REPLIES 9

Chuck Tomasi
Tera Patron

Hi Carl,



You can write yourself a BEFORE insert business rule that copies the value of the variable to the value of the field.



current.cmdb_ci = current.variables.configuration_item; // or what ever your variable is called.



Business Rules - ServiceNow Wiki


Business Rules Best Practices - ServiceNow Wiki  


Hello Chuck,



Thank you for coming back to me.



I have had a look and unfortunately I do not understand how to setup Business Rules (told you I am unfortunately new to this)



What I would ideally like to do is add the 'Configuration Item' into the below form and then input this so when someone fills in this form, then the 'Configuration Item' shows within the 'Requested Item'



find_real_file.png



find_real_file.png


I just don't know if this is possible to do?


Hi Carl,



What you propose is not difficult, it just requires a little understanding. I recommend doing some reading and research before tackling this. The service catalog is one of the complex apps in the ITSM suite. Here are some resources to help get you started.



Introduction to Service Catalog - ServiceNow Wiki


System Administration



If you still need assistance, feel free to reach out to ServiceNow or one of our partners for a professional services engagement.


Hi Carl,



If I understand your question correctly then I am assuming you want to populate configuration item field on requested item with the value user has field on the catalog item form at the time of request. Correct me If I am wrong



Assuming the above case is true then here are the steps to be followed.


Go to system definition->Business rule->Create new->Select table as requested item


Click on advanced checkbox to true->Select when as before and insert and update checkbox to true(depending on your req)->Click on advanced tab and paste the below script under function template on your instance. Please replace variablename and then paste the script.


current.cmdb_ci = current.variables.VARIABLENAME; //Replace VARIABLENAME with the exact name of the catalog variable



Please refer screenshot attached for reference.


Screen Shot 2016-07-01 at 3.06.54 PM.png


Screen Shot 2016-07-01 at 3.07.02 PM.png



I hope this helps



Reference links :


Business Rules - ServiceNow Wiki


Business Rules Best Practices - ServiceNow Wiki