- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2015 04:48 AM
Am trying to set the fields for 'Assignment group = Microsoft team ' and 'Category 1 = Application and Category 2 = Microsoft, for an inbound Forwarded Email action.
Can someone please help with this. Am currently using an OOB script, as below. Thank you.
current.comments = "forwarded by: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
// create the caller only if I have itil role
//if (gs.hasRole("itil"))
// current.caller_id = gs.createUser(email.body.from);
current.opened_by = email.from_sys_id;
current.assignment_group.setDisplayValue("Microsoft");
//and
current.assignment_group = ("Microsoft");
current.u_cat_1 = ("Application");
current.u_cat_2 = ("Microsoft");
current.incident_state = 1;
current.notify = 2;
current.contact_type = "email";
if (email.body.assign != undefined)
current.assigned_to = email.body.assign;
if (email.body.priority != undefined)
current.priority = email.body.priority;
current.insert();
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2015 05:17 AM
current.assignment_group.setDisplayValue("Microsoft"); // This is correct
// current.assignment_group = ("Microsoft"); // This is wrong correct way is shown below
current.assignment_group = 'sys_id' of the group ; // this is right
current.u_cat_1 = ("Application"); // this is wrong there should not be a bracket after assignment operation, rather it should be a value of choice
current.u_cat_2 = ("Microsoft"); // this is also wrong
current.u_cat_2.setDisplayValue('Microsoft'); // this is right similarly do for 1st category
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2015 04:59 AM
You can do current.assignment_group.name = 'Microsoft';
But, I'd probably just find the sys_id and use it.
What exactly is happening? Nothing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2015 05:13 AM
You could also use a template to set some values
//Apply template
current.applyTemplate("name of template");
Otherwise it's probably easier to do this with the sys_id of the group. By using the sys_id the inbound action will still work even if you change the name of the group.
current.assignment_group = '7285123a54e45580342fab8ffa2f5a7d'; //Microsoft team
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2015 05:17 AM
current.assignment_group.setDisplayValue("Microsoft"); // This is correct
// current.assignment_group = ("Microsoft"); // This is wrong correct way is shown below
current.assignment_group = 'sys_id' of the group ; // this is right
current.u_cat_1 = ("Application"); // this is wrong there should not be a bracket after assignment operation, rather it should be a value of choice
current.u_cat_2 = ("Microsoft"); // this is also wrong
current.u_cat_2.setDisplayValue('Microsoft'); // this is right similarly do for 1st category
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2015 05:50 AM
Thanks guys.. Much appreciated.