How to use opened_by field to submit requests on behalf of someone else?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2019 07:33 AM
Hello everyone,
I have a requirement to use only the opened_by field to submit request on behalf of the user logged in or on behalf of someone else. I have made the field editable through the dictionary override but when I submit a request on behalf of someone else (changing my name to the persons name in the opened_by field) the case doesn't show on his or my requested items page. How can I make this change to both me and the user I opened the case for can view the request on the page (My Requests)?
Will greatly appreciate the assistance.
- Labels:
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2019 07:36 AM
You cannot use opened_by for this purpose, generally a requested for field is used for this. Opened by will always hold the original person who logged the ticket because that is also an important information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2019 07:28 AM
Hello Anurag,
Thanks for your reply. I have decided to go with adding a field opened_for to select the users from the users list (as a reference field). Now I am running into the following issue.
I want to filter the My Requests for users that are on the opened_by, assigned to and opened_for fields in the Service Portal. I am using an OR clause in the conditions within a Data Table from Instance widget. The opened by its driven by the logged in user (that actually opens and submits the request) which is automatically selected. The assigned to is linked through a dependency with the assignment group on the request and when assigned to a person on that group is will show on the assigned user's requests. These two show the users that are listed, however if the request needs to be opened on behalf of someone else (we want to also show the request on this persons My Requests), using the opened_for field, it is not showing the request and says No Requests in the service portal page for My Requests.
Will really appreciate if you have an idea on how to get this accomplished.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2019 08:07 AM
have to mention this table is a custom table extending from task. The opened_for field is a custom reference field pointing to the users table. The default value I left it empty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2019 07:43 AM
If you're creating the record via script you can use the below code to submit the record as any user you want. I second what Anurag says though, you're best off just using the requester field, it is what it's there for after all
var gr = new GlideRecord('incident');
gr.initialize();
//code to populate fields etc
var impUser = new GlideImpersonate();
impUser.impersonate('sys_id of user');
gr.insert();