Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to pass catalog variables to sc task

aakashdhanush7
Tera Contributor
 
2 REPLIES 2

Tushar
Kilo Sage
Kilo Sage

Hi there,

 

I think you can achieve this using flow designer,

Create a flow and select the appropriate trigger for your flow. 

This could be a user input, a scheduled trigger, or any other event that initiates the flow.

 

Add a "Create Record" action: Drag and drop the "Create Record" action from the action palette onto the canvas.

 

Configure the "Create Record" action:

a. Set the "Table" field to "sc_task" to create a new Service Catalog Task record.

b. Map the relevant catalog variables from the flow inputs to the corresponding fields in the sc_task record. You can do this by clicking on the "Map Inputs" button and selecting the appropriate flow

variables for each field.

 

Thanks,

Tushar

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @aakashdhanush7 

Greetings!

are you using workflow to create sc task?

You can populate the values from workflow.

You can use below after insert BR.

var gr= new GlideRecord("sc_req_item");

  gr.addQuery('request',current.getValue("sys_id"));

  gr.addQuery("item.name","put your item name here");

  gr.query();

  while(gr.next()){

  current.field_name = current.variables.variable_name

  }

 

 

refer the below thread: https://www.servicenow.com/community/developer-forum/grab-ritm-variables-and-put-them-in-sc-task-fie...

 

Help others to find a correct solution by marking the appropriate response as correct answer and helpful!!

 

Kind Regards,

Ravi Chandra.