- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2023 11:57 AM
Hi Team,
I created UI action (Create Inc) on RITM
If we click on Create Inc then it should redirect's to Incident.do page with auto populate fields of RITM.
Ex.
Caller = Assigned to
Short description = short description
Description = description
Priority = Priority
Assignment group = Assignement group
Help me on the Same
Thanks Anil!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2023 12:57 PM
Hi @AnilM99 ,
Create an UI action form button, select the 'client checkbox' and mention the onclick function, you can copy the below script, it should work
UI Action script
function openIncident() {
var query = 'caller_id=' + g_form.getValue('assigned_to') + '^short_description=' + g_form.getValue('short_description') + '^description=' + g_form.getValue('description') + '^priority=' + g_form.getValue('priority') + '^assignment_group=' + g_form.getValue('assignment_group');
var url = new GlideURL('incident.do');
url.addParam('sys_id', '-1');
url.addParam('sysparm_stack', 'no');
url.addParam('sysparm_query', query);
var w = getTopWindow();
var newWindow = w.open(url.getURL(), "_blank");
newWindow.focus();
}
If my answer has helped with your question, please mark it as helpful and accepted solution.
Thanks,
Karan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2025 10:33 AM
I liked the pattern of your response (Amit Gujarathi) but found out that '&' shouldn't be used:
eg the lines similar to:
url += "&priority=" + encodeURIComponent(priority);
need the ampersand (&) changed to the caret (^), which works.