How to copy data into the TASK from the RITM

stevenhumpherso
Giga Contributor

Good day, ever helpful community...

I have a situation where my production instance of ServiceNow 'somehow' copies the inputs from the Service Catalog input (RITM) into the task.   However it does not do this on my Dev instance.   Could you wonderful people please advise on how I can find out 'HOW' this has been done.   So that I can mirror both systems.   I did not build the original service Catalog in production.   I am therefore building\testing the updated Service Catlog for IT & a brand new SC for our facilities team.

I'm currently in testing for the new catalog (for Facilities) & I've noticed that for both the standard IT service catalog (which I have built)   & the newly created facilities Service catlog (which ive also built) this is not available.   please see example screenshots.

Production (not built by me)

find_real_file.png

Dev (built by me)

find_real_file.png

I'm aware that this 'may' turn into a long list of places to check.   I'm also aware that when I transfer the update sets from dev to prod this may also 'just work'... however.   I don't want to take any chances & would love any help to get to the bottom of this.   plus surely dev should match prod.  

Once found.   I will also happily post 'how' this was done.   As I've noticed & found a number of posts asking how to do this.

Thanks in advance.

1 ACCEPTED SOLUTION

Check the Catalog Task activity and look for a statement in the script section that copies the item variable to the task work notes.   Something like:


task.work_notes = current.variables['your_variable_name'];



Also, do you know that you don't have to copy the variable contents to the task if you are only trying to make them visible to your techs?   You can show the variable on the task just by using the Add variables section of the workflow, then adding the variable editor to the task form.


View solution in original post

14 REPLIES 14

Hi Katie, many of the workflows im using in the dev setup are those created previously.   But I will check again.   I couldn't see 'anything' that jumped out.  


Hi Katie, this is one the workflows.   I cannot 'see' where this may have been entered.   could you point out where I could\should check?



find_real_file.png


Check the Catalog Task activity and look for a statement in the script section that copies the item variable to the task work notes.   Something like:


task.work_notes = current.variables['your_variable_name'];



Also, do you know that you don't have to copy the variable contents to the task if you are only trying to make them visible to your techs?   You can show the variable on the task just by using the Add variables section of the workflow, then adding the variable editor to the task form.


Thank you.   But for those (like me) that need a little more guidance.   I'll explain...



The way this was configured in my system (by a previous person) was that the 'task' in the workflow had been given access to the variables that were created when building the 'catalog item'...



Let me show you.   Here is the workflow in question...



find_real_file.png



I therefore 'checked out' the workflow then opened up the 'Catalog Task'...   Then I scrolled to the bottom & added all of the variables to be available ...



find_real_file.png


now i'm guessing that any new variable I create, for a new item in the service catalog, will then need to be added to the workflow Catalog task.   Yes im sure this isn't ideal.   However IT DOES WORK.   Not perfect.   but I'll redesign this feature once all of my new work is into live.   maybe... lol.



As always.   thank you all for your help.  


jd3737
Tera Contributor

Using this line of code, is there a way to grab all the variables on the form at once or do I need to add each one separately?