- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2023 06:30 AM
We need to assign the assignment group of the SCTASK to a variable to pass it through 3rd party integration through rest message. I have used the var grp= current.assignment_group but the value is coming as undefined. How to get the value of the assignment group? Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 02:52 AM
Instead of writing :
var agrp = sap.current.variables.assignment_group.name;
You can directly write:
var agrp = sap.assignment_group.name;
This way it will directly get the name of sc_task assignment group. By accessing it through current.variables it is going to the catalog variables and getting the value which has been assigned to it while raising request.
Please mark helpful if it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2023 10:00 AM
@Savitha4 You have written glide wrong
var sap = new GlideRecord('sc_task');
sap.addQuery('request_item.number', current.number);
//sap.addQuery('assignmentgroup', current.assignment_group);
var agrp = sap.current.variables.assignment_group.name;
gs.log('agrp is' + agrp);
sm.setStringParameter("assignmentgroup", agrp);
gs.log('assignmentgroup' + sap.assignment_group.name);
sap.query();
sap.next();
It should be
var sap = new GlideRecord('sc_task');
sap.addQuery('request_item', current.sys_id);
sap.query();
if(sap.next()){
var agrp = sap.current.variables.assignment_group.name;
gs.log('agrp is' + agrp);
sm.setStringParameter("assignmentgroup", agrp);
gs.log('assignmentgroup' + sap.assignment_group.name);
}
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 02:52 AM
Instead of writing :
var agrp = sap.current.variables.assignment_group.name;
You can directly write:
var agrp = sap.assignment_group.name;
This way it will directly get the name of sc_task assignment group. By accessing it through current.variables it is going to the catalog variables and getting the value which has been assigned to it while raising request.
Please mark helpful if it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 11:05 AM
Thank you. It worked.