asifnoor
Kilo Patron

 

Hello

In this article I will show you how you can create new RITMs for the existing request thorugh script.

 

Technically we create RITMs along with the request. If multiple RITMs, we can use cart API and can create multiple ritms as well there. However, if there is a requirement (not ideal) to create ritms after the request is created. In our case, we had to submit a catalog item request when a user is created.

 

I had used flow designer and invoked Submit catalog item Action of Flow designer.

 

1676977953598.png

As you can see, i am submitting the catalog item to create an request whenever a user is created. 
Then we have a wait for condition waiting for request approval. Once the request is approved, I need to create few more additional RITMs based on teh number of applications that user need to grant for. 
 
So i used create Record for sc_req_item and use the request field. So ritms are created and linked to the same request. 
 
1676981454936.png
However, variables are not passed into the RITM. So for this i have created a custom action which will take the variables from the initial RITM and copy it to the newly created RITMs.
 
ActionAction
Input variablesInput variables
 
 
Script to copy variablesScript to copy variables
When i ran this, then the output will look like this.
 
Initial Request
1676982118935.png
 
After the request is approved, then we can see more RITMs for the same request.

1676982204549.png

Let me know if you have any questions in the comments below.

 

Mark the article as helpful and bookmark if you found it useful.

Comments
Kalyani35
Tera Guru

Hi,

I am using same approach for generating multiple RITMs but with the RITMs created from this flow, the flow associated with catalog item does not get triggered.

Did you face anything like that?

tmwrapelee
Tera Contributor

I tried the same methodology and got the same results as Kalyani35.  I am curious as to how you got the multiple items for one request with stages.  Did you call the flow somehow for the additional items?

twl

Lon Landry4
Mega Sage

I can get the new RITMs to populate, but MRVS data is not included.

Were you able to get MRVS data to populate in the new RITMs?

mipalm
Tera Guru

Hi, 

This helped a lot! 

I'm facing an issue however where its passing all the data correctly, except for my multirow variables, any idea how to fix this?

mipalm_0-1705428729296.png

 

Natalia Arenas
Tera Contributor

@mipalm Hi, did you solve the issue of the Variable formatter not copying in the ritm? I'm facing the same situation

mipalm
Tera Guru

@Natalia Arenas Hi, do you mean the variables inside the multirow? Yes, i used the 'Submit Catalog Item Request' in the flow designer. This creates a new RITM for each line (inside the for each).

If you want to maintain the Multirow as is but with only one line, you need a variable inside the multirow to separate each line, for me was 'user attachment'. From here you need to copy the questions and answers from the multirow table and add them to the new RITM. I will add some screenshots of my code, if you have any other question i can help with regarding this issue, let me know .

(this is a script action inside the flow, the inputs are new Ritm sys that is created in the flow before, parent sys aka the original ticket and user attachemnt which is the variable im using to diferentiate the rows)

 

mipalm_0-1715177200307.pngmipalm_1-1715177223665.png

 

Somesh Poal
Tera Explorer

Hi @asifnoor ,

 

I have implemented the same functionality but when executing it is creating a new blank record automatically apart from the corresponding MRVS entry.

 

Do you have any idea why is this happening?

 

 

Mark Brogna
Tera Contributor

how did you get the flow to start for those new ritms?

Jorn van Beek
Tera Guru

if the flow trigger is catalog and the flow is connected to the catalog item itself. then it will trigger by default when the ritm gets state request approved. There is no need to create any custom thing.

Version history
Last update:
‎02-21-2023 05:19 AM
Updated by:
Contributors