How to extract Assignment group from Catalog Item to SCtask assignment group

Sid2024
Tera Contributor

Hi

 

Can you please assist with extracting the assignment group from a catalog item to set it as the assignment group for an SCTask?

 

Once a user selects the assignment group, this information should be captured from the RITM and assigned to the SCTask assignment group.

 

 

The General Service Request is an SCTask selected from the Select Request Template.

 

The Assignment Group is a reference field that obtains its information from the sys_user_group table and is named

assignment_group.

 

Sid2024_0-1720384959000.png

 

 

SCtask assignment group

Sid2024_1-1720385539713.png

 

 

2 ACCEPTED SOLUTIONS

Hi @Sid2024 

 

Let me know if you face any difficulties. 

 

Please mark the solution as correct if it works for you.

 

Thanks!

Ramkumar

View solution in original post

Hi @Sid2024 ,

 

You can write a before Business Rule on Catalog Task (sc_task) table.

Advanced: true

 

When to run:

before (insert)

Conditions: add if any

 

Advanced script:

(function executeRule(current, previous /*null when async*/) {

	current.assignment_group = current.request_item.assignment_group;

})(current, previous);

 

 Hope it works 😊.


Mark the response correct and helpful if the answer assisted your question.

View solution in original post

8 REPLIES 8

Rupanjani
Giga Guru

Hi @Sid2024,

 

Write after BR on sc_req_item table.

Table: sc_req_item

Advanced : true

 

When to Run

after (insert/update) - as required for the requirement

Condition: Assignment group changes

 

Advanced Script:

var grSCTASK = new GlideRecord('sc_task');
grSCTASK.addQuery('request_item.sys_id', current.sys_id); 
grSCTASK.query();
if(grSCTASK.next()){ //use while if there are more than 1 sctasks
grSCTASK.assignment_group = current.assignment_group;
grSCTASK.update();
}

 


Mark the response correct and helpful if the answer assisted your question.

Sid2024
Tera Contributor

I need the assignment group to be auto populated on catalog task while creating, from request item.

Hi @Sid2024 ,

 

You can write a before Business Rule on Catalog Task (sc_task) table.

Advanced: true

 

When to run:

before (insert)

Conditions: add if any

 

Advanced script:

(function executeRule(current, previous /*null when async*/) {

	current.assignment_group = current.request_item.assignment_group;

})(current, previous);

 

 Hope it works 😊.


Mark the response correct and helpful if the answer assisted your question.

Hi Rupan,

It is now working correctly.

Thank you so much for your help.