How to set the fulfillment assignment group?

SNOW39
Tera Expert

How can i set the assignment group to X using workflow for a catalog item?

Please help me with the steps

2 REPLIES 2

Sandeep Kumar6
Giga Guru

Hi Snow,

As you might be knowing that Assignment Group on catalog form is a reference field to Group table in ServiceNow.

So you might need sys_id of that group to assign to the field.

You can write below code in any activity of Workflow like run script or task etc.

 

Now second thing is to know that your workflow is on which table global or sc_cat_item.

if this is on sc_cat_item then you can write current.assignment_group == "sys_id of group";

otherwise you have to glide record the sc_cat_item and find current record in that table to assign assignment group.

like below:

var gr = new GlideRecord('sc_cat_itme');

gr.addQuery('sys_id',current.sys_id);

gr.query();

while(gr.next())

{

gr.assignment_group= "sys_id of group";

}

 

Please hit correct if this gave your answer.

Regards

Sandeep

 

ChanakyaMekala
Kilo Guru

You can use two activities for that 

1. Set Values  activity under Utilities
                    - Here you can assign any fields on the current record on which the workflow is/will be running.(For ex: Assignment Group = (required group))

2. Run script activity under Utilities

                    - Here you can assign any fields or execute any script based on the requirements.(For ex: current.assignment_group = sys_id of the required group or you can assign dynamically)

 

Prefer 1 over 2. If anything is not able to accomplish using "Set Values" Activity then use "Run Script" activity

 

Please mark helpful or answered if it did help you.