Copy submitted request item variables into another similar request item

Marques2
Tera Expert

Hello All,

We're putting in place a temporary virtual server request process until we're ready to integrate with VMware. In doing this, I have a requirement to copy a submitted request item's variables into a catalog item when completing the new request. Might sound confusing but it will be extremely valuable. We have users who submit alike server requests with slight differences in the request details- So copying an "old request's" variables will make their experience shorter and less repetitive.

I found this article where someone talked about what they were able to accomplish the above task: An Exercise in Sensibility — Copy a Request | Sensible ServiceNow

However, there isn't any code included to help assist me. The short 2:00 min video also shows EXACTLY what I'm trying to accomplish: ServiceNow - Copy Request Variables - YouTube

Has anyone been able to accomplish something like this?

Any help is much appreciated!


Thank you,

-Marques

2 REPLIES 2

shouvik
ServiceNow Employee
ServiceNow Employee

You can try cloning the request to another request for another user. Clone Request


If you want to access the variables in a RITM, you can use current.variables.<variable_name>.getValue()



Thanks


Shouvik


PS: Hit like, Helpful or Correct depending on the impact of the response


D_Roquette
Kilo Contributor

I need the same functionality. After searching for a couple hours, I came across this link with scripts posted by Justin Bauguess. I tried it and it worked for me.



https://gist.github.com/jmbauguess

Back end functionality to copy variables from one requested item to another · GitHub