
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2014 02:38 PM
I'm using an Assignment rule to populate the "Assignment group" field, and thought I could set the "Assigned to" field to be the current user while I'm at it. I thought this would be a simple statement, like:
current.assigned_to = gs.getUser();
but this doesn't seem to be working. I can get this working with a business rule (user as Dynamic Default of "Me"), but would prefer to use an Assignment rule instead. Any ideas?
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2014 06:56 AM
If you are going to use a Script, I don't think you can have anything populated in the User or Group fields. If you do, I think it ignores the script. Try blanking those two fields and use something like this for your script:
current.assigned_to = gs.getUserID();
current.assignment_group.name = 'Network';
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2014 10:13 AM
Is the user a member of the assignment group? Maybe a business rule is preventing the assignment to a user that is not a member of that group.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2014 11:51 AM
It's a baseline system, I didn't see any conflicting rules or anything like that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2014 12:25 PM
whenever i am trying to get something like this done.. my first thought is "where can i steal that code from".... incident has an "assign to me" button as a ui action...
if you look in it you will find the meat of the code is the line...
g_form.setValue('assigned_to', g_user.userID, userInfo.userName);
i would probably steal the whole function just to be safe but i suspect you can do it with just that one line.
--------------entire function
function assignMe() {
var ga = new GlideAjax('SoloGroupMember'); // the Script Include object name
ga.addParam('sysparm_name','lookupMember'); // the function on the server to call
ga.addParam('sysparm_user', g_user.userID); // required information to perform lookup
ga.getXMLAnswer(isSolo); // function to call when the server responds
function isSolo(answer) {
jslog("***** is solo answer: " + answer);
if(answer) {
var userInfo = answer.evalJSON();
if (userInfo.groupID){
g_form.setValue('assignment_group', userInfo.groupID, userInfo.groupName);
}
g_form.setValue('assigned_to', g_user.userID, userInfo.userName);
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2014 06:56 AM
If you are going to use a Script, I don't think you can have anything populated in the User or Group fields. If you do, I think it ignores the script. Try blanking those two fields and use something like this for your script:
current.assigned_to = gs.getUserID();
current.assignment_group.name = 'Network';
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2014 07:22 AM
Michael,
That seems to be correct. It won't take the mix and match of field and script.
Thanks!