I have a Generic Request Item workflow that I want to use for most of my Catalog Items when ordered: At the moment my RITMS and CSTASKS are assigned the same Fullfiler Group as I have set as 'Approver' Group for the REQ. How do I set the RITM and S

sadfa
Kilo Contributor

Hi Cummunity,

I have a Generic Request Item workflow that I want to use for most of my Catalog Items when ordered:

At the moment my RITMS and CSTASKS are assigned the same Fullfiler Group as I have set as 'Approver' Group for the REQ

How do I set the RITM and SCTASK Fullfiller Group to pick up the Fulfillment Group value stored in the 'Fulfillment group' attribute in the Catalog task?

I guess this can be done in the Catalogue Task but not sure how? Greatful for assistance:)

Thank You

Sadfa

Fullfiler.jpg

10 REPLIES 10

Inactive_Us2231
Giga Expert

Hi Sadfa,



From what i understand, if you want to set the value of the fulfillment group of your catalog item table on to its corresponding RITM and CTASK , all you have to do is create a run script activity in the workflow running on the RITM table.


something like this,



var item = current.cat_item; // since wrkflow is running on the ritm table


var gr = new GlideRecord ('sc_cat_item');


gr.get(item);


var fulfillmentGroup = gr.group; // group is the dictionary name in the catalog item table


current.assignment_group = fulfillmentGroup;



to set the same assignment group value on the ctask you can write a before BR on sc_task table


current.assignment_group = current.request_item.assignment_group;



I have not tested this, but i believe this should work. Hope it helps!



Please mark helpful/correct based on the impact of the response


The run script worked great, thanks:



var item = current.cat_item; // since wrkflow is running on the ritm table


var gr = new GlideRecord ('sc_cat_item');


gr.get(item);


var fulfillmentGroup = gr.group; // group is the dictionary name in the catalog item table


current.assignment_group = fulfillmentGroup;



But not sure how to apply 'before BR on sc_task table', is that a new workflow on the Task table, or just an additional action to the existing workflow running on the RITM table?



Grateful for advise:)



Thanks!


Ashutosh Munot1
Kilo Patron
Kilo Patron

HI Sadfa,



Write below code in


1: RunScript Activity which should be at the beginning of the workflow:



var gr = new GlideRecord('sc_cat_item');


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


gr.query();


if(gr.next())


{


current.assignment_group = gr.fulfillment_group; //Field Name of Fulfillment group


current.setWorkflow(false);


current.update();


}



2: Write below code in catalog task:



var gr = new GlideRecord('sc_cat_item');


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


gr.query();


if(gr.next())


{


task.assignment_group = gr.fulfillment_group; //Field Name of Fulfillment group


}



Thanks,






Hi Ashutosh,



For sc task, there is no need to query sc_cat_item again as the value will be there on the ritm already. Just a suggestion