- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi guys!
I have created a variable inside a Catalog item that it's a reference type to the table service_offering. I have called it assignemnt_group. This variable is working fine.
Then I have created the Assignment rule that applies to this item, but the script is not working for me.
I have tried with several things, no good results. There is a way I can do this, but with the variable instead with an specific value?
current.assignment_group.setDisplayValue("name_of_assignment_group_2");
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Cristina,
if the assignment group is on service catalog form this works
if you need you need Assignment group to be picked from catalog variable
you can proceed with Assignment Rule, Flow Designer or BR Approach with below script can be used in Assignment Rule and Before BR on insert
if (current.variables.assignment_group) {
current.assignment_group = current.variables.assignment_group.toString();
}
with Flow get the Catalog variable action and update the RITM record.
if the solution works kindly mark helpful
Regards
Sudhanva Chandra D
Certified ArchX || 8x ServiceNow CIS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
By the way, this is not working:
current.assignment_group.setValue(current.variables.assignment_group)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
hi @Cristina Esteve ,
Since your catalog variable is a reference to the service_offering table, first check what value it returns. Also, make sure the reference variable name is correct.
You can try the following in your Assignment Rule script:
var offering = current.variables.assignemnt_group;
if (offering) {
current.assignment_group = offering;
}
However, there is one important point: your variable references service_offering, while current.assignment_group normally references sys_user_group. These are different tables, so you cannot directly assign the service offering sys_id to the assignment group field.
If you want to set the assignment group based on the selected service offering, query the relevant service offering record, retrieve the associated assignment group, and assign that group's sys_id to current.assignment_group.
If this helped, mark it helpful and accept the solution.
Regards, Tejas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Cristina Esteve,
You are trying to add reference of service offering table to group table. Instead, do a glide record on group table, query by name contains service offering and return that group in assignment rule.
Please Accept this response as Solution if it assisted you with your question & Mark this response as Helpful.
Kind Regards,
Ehab Pilloor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Cristina,
Please use the below script in assignment rule and make sure it should only Applies to is set with proper item condition
if (current.variables.assignment_group) {
current.assignment_group = current.variables.assignment_group.toString();
}
variable name should be "assignment_group " and mapping field in ritm or any task should be "assignment_group"
if the solution works kindly mark helpful
Regards
Sudhanva Chandra D
Certified ArchX || 8x ServiceNow CIS