Set Values and Run Scripts node of workflow

Saquib Mohammed
Mega Guru

Hi

I need to set the assignment group of a catalog task with the value of a variable from catalog item. 

My first question is related to set values node of workflow. Is it possible to access the catalog variables using the set values node and make this assignment. 

My second question is around Run Scripts node. Can someone show a sample run script that I can use to set the assignment group of the catalog task with the catalog variable (say managed_by_group)

Appreciate any pointers. Thank you. 

2 REPLIES 2

Dnyaneshwaree
Mega Sage

Hello @Saquib Mohammed ,

1. We are able to directly set the values of any variables of catalog item present in the RITM or any fields value of RITM and also inherited by RITM(by using "Show related fields") but as per your requirement we need to map the fields values. so, it is not possible using "Set value" action of the workflow.

2. We are able to use script logic in the "Run Scripts" action of the workflow by using glide record or accessing values using dot walk and then mapping. If the run script is required then let me know. I will also help you in that.
3. But if you are creating the same task from the workflow which assignment group needs to set then you can directly use the script logic in the "Catalog task" action of the workflow.

Please use below code in the "advanced script" section of catalog script activity:  

Dnyaneshwaree_0-1717142227643.png

 



task.assignment_group= current.variables.managed_by_group;      // Please update the assignment group field name of the task and managed_by_group variable name of catalog item/ RITM as per your requirement
// Note: variable of catalog item (managed_by_group) need to present/visible on the RITMand sc_task tables.

Check the values by adding logs . If the below is not working then let me know i will update it as per your suggestions.

If my answer helped you in any way, please then mark it as helpful and acceptable.

Thank You in advance!!

 



 
Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!

Dnyaneshwaree Satpute
Tera Guru

Hi  Dnyaneshwaree

Thank you for the information. Adding the catalog script in the Create Task node didn't work. The catalog task is not even getting created now. Removing the catalog script generates the catalog task but does not set the assignment group, which is understandable. But adding the script doesn't let the sc_task to get generated at all. 

Note that this workflow is at the request level - not at the requested item level.  current.variables should still be accessible at the request level- correct?