- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2013 01:57 AM
I am looking to create a new dictionary attribute which would be applied to the assigned to field.
When pressed it would insert the name of the person currently viewing the ticket.
I'm having some trouble however locating where the attribute records are kept.
Any pointers?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2013 04:21 AM
Here's a more elegant solution that just uses a small UI Macro and a dictionary attribute:
http://www.servicenowguru.com/system-ui/ui-macros/add-me-ui-macro-user-group-fields/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2014 02:08 PM
Shane,
You'll want to use a Decoration for this http://wiki.servicenow.com/?title=Reference_Fields#Decorations
5.3 on the link above has an example that you can modify from incident.
Andy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2014 02:15 PM
I am using the "Assign to me" form button as a base to accomplish, but made a new one called "Assign to me (ServiceDesk)".
I tried the following script, but it is not filling in the assignment group field still:
current.assignment_group.setDisplayValue('IT ServiceDesk');
current.assigned_to = gs.getUser();
current.doRedirect = true;
action.setRedirectURL(current);
current.update();
Any ideas?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2014 07:31 PM
ShaneCossever wrote:
I am using the "Assign to me" form button as a base to accomplish, but made a new one called "Assign to me (ServiceDesk)".
I tried the following script, but it is not filling in the assignment group field still:
current.assignment_group.setDisplayValue('IT ServiceDesk');
current.assigned_to = gs.getUser();
current.doRedirect = true;
action.setRedirectURL(current);
current.update();
Any ideas?
Thanks
FYI: Your exact code is working for me, with the exception of the gs.getUser() ... it should be gs,getUserID().
You can accomplish the same thing with:
current.assignment_group.setDisplayValue('Service Desk');
current.assigned_to = gs.getUserID();
current.update();
action.setRedirectURL(current);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2014 09:16 AM
That explains a few things.
I tried this, and the page is trying to submit/update, however my Assignment Group flashes and pops up a warning because it is a mandatory field. It is not being filled in still. Will I have to change the script due to the field being mandatory? We don't want anyone submitting an incident without filling in an assignment field.
Thanks!
Edit: I filled in an Assignment Group manually, then tried the form button again, and it filled in the Assigned To field with my username, but emptied out the Assignment Group field and saved the page. Guess I've hit a snag somewhere.
Edit 2: Got things working, but ONLY if assignment group has an entry in it already while I am still on the New incident form. A save is not needed. I go to New incident, fill out something in all of the mandatory fields, and then click my new Form Button, and it fills in the Assignment Group and Assigned To properly. However if Assignment Group has nothing filled in, aka is blank, and I try my new Form Button, it will flash and say it is mandatory. Ccde is:
current.assignment_group.setDisplayValue('IT ServiceDesk');
current.assigned_to = gs.getUserID();
current.update();
action.setRedirectURL(current);