- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 06:19 AM
HI Community,
I have a requirement; task needs to be assigned to requested for's hub.
Requester's hub assignment group can be found in the field called Hub on the Location form of the location the requester is assigned to. For example, if the requester's location (mentioned in the Location field of their user profile) is OH-Ohio-Work then the hub assignment group for this location mentioned in the Hub field of this location screen will be the one the above-mentioned task will be sent to.
For that i have created a catalog task and in advanced condition written this script
Thanks in Advance!
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 12:30 AM
Oh well if its a group, you need to change cmn_location to sys_user_group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 08:11 AM
The hub field in location form is single line text field is something to do with that because of that is it causing issue
because in xml i can see empty display value and no sys id is present

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 09:29 AM
Ah yes that would cause an issue as it's not a reference. You should perform a lookup to ensure the value is a valid location record
var hubName = hubs.getValue()
var locationGR = new GlideRecord('cmn_location');
locationGR.setLimit(1);
locationGR.addQuery('name' , hubName);
locationGR.query();
if(locationGR.next()){
task.setValue('assignment_group' , locationGR.getUniqueValue());
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 09:56 AM
I tried like this but no the task assignment group is empty like no value is there

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 12:10 AM
Are you sure the hubName being used is a valid location? If you search for it manually, can you find a location with that name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 12:17 AM
Actually the hub field (single line) in location form stores the data/value of group name and task needs to be assigned to that group and yes I checked in groups table the hubname value that group is present