How to Trigger change workflow/record producer from transform script

Sachin Jain1
Giga Contributor

We have a requirement to create a change request with workflow and approval from a transform map script.

to create the change record, we have a record producer in place. But i'm not sure how to trigger the record producer from transform script and how to ploulate theRP variables.

I tried using Catalog API as mention below but it is creating a RITM instead of change request.

 

var cart = new Cart();
var item = cart.addItem('sys id of record producer');
cart.setVariable(item, 'RP variable name', source.TransformMapVariableName);
.....
var rc = cart.placeOrder();
gs.log(rc.number);

 

above code is not working, is there any other mathod to invoke change_request with workflow from a transform script ?

 

Pradeep Sharma can you help ?

37 REPLIES 37

Hi,

This requirement is very urgent for me.

How to invoke Variable sets in Business Rule?

I can see the code in Script Include : 

setVariables: function(variableObject) {
        this.userVariables = variableObject;
    },

Through setVariables, can I call Variable sets? Need to confirm what to pass in the variable object? i mean in what format, Please help as it is very much urgent.

venkatkk
Tera Contributor

Is it possible to add static values to the variables ?

Cristiano,

 

This script is adding the variables to my script-created RP but the variables it needs to add are in a multi-row variable set. Any idea how this can be used for that? I'm having issues determining how to display the variables within the MRVS. They are being displayed one after the other without the MRVS functionality to add more rows.

gowthamanbalu
Tera Contributor

Thanks! This is really helpful.. I need an quick assistance that I could not get the variable editor on ticket form when I trigger this script. Am I missing something?

were you able to get the variable editor on the form when using this script?