Help with Agent Workspace modal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2019 11:48 AM
We recently upgraded to Madrid and I am attempting to configure Agent Workspace with functionality similar to our advanced view for closing incidents. We have a UI Action popup for proposing a solution to an incident before the task is closed. The popup includes a field for comments(text area), close_notes(text area), close_code(choice list), ticket_type(choice list) and duplicate(reference). The duplicate field is a reference to the incident table. The field appears on the modal and it has a magnifying glass so it must recognize that it is a reference field and when I click on it, there is a popunder that shows "Searching..." However, it won't display a list to choose from and clicking the magnifying glass does not do anything either. Additionally, the size value does not appear to have any affect of the size of the modal window.
Here is the code I'm working on to create the modal:
//Get all the Close Codes
var gA = new GlideAjax("GlobalAgentWorkspace");
gA.addParam('sysparm_name', 'getITTicketCloseCodes');
gA.getXMLAnswer(openModal);
//openModal(taskId,table);
function openModal(answer){
var closeCodes = JSON.parse(answer);
if(!closeCodes){
closeCodes = [];
}
var fields = [
{
type: 'textarea',
name: 'comments',
label: getMessage('Proposed Solution'),
mandatory: true
},
{
type: 'textarea',
name: 'close_notes',
label: getMessage('Close notes (Private)')
},
{
type: 'choice',
name: 'close_code',
label: getMessage('Close code'),
value: getMessage(' -- Select -- '),
choices: closeCodes,
mandatory: true
},
{
type: 'choice',
name: 'u_ticket_type',
label: getMessage('Ticket type'),
value: getMessage(' -- Select -- '),
choices: [
{
displayValue: 'Issue',
value: 'Issue'
},
{
displayValue: 'Request',
value: 'Request'
}
],
mandatory: true
},
{
type: 'reference',
name: 'parent',
label: getMessage('Duplicate IT Ticket'),
table: 'incident',
query: 'active=true'
}
];
//open the popup
g_modal.showFields({
title: getMessage('Confirmation: Solution Proposed'),
fields: fields,
size: 'sm'
}).then(function(fieldValues){
var newProposedSolution = fieldValues.updatedFields[0].value;
var newCloseNotes = fieldValues.updatedFields[1].value;
var newCloseCode = fieldValues.updatedFields[2].value;
var newTicketType = fieldValues.updatedFields[3].value;
var newDuplicateITTicket = fieldValues.updatedFields[4].value;
//alert("newProposedSolution: " + newProposedSolution + "\nnewCloseNotes: " + newCloseNotes + "\nnewCloseCode: " + newCloseCode + "\nnewTicketType: " + newTicketType + "\nnewDuplicateITTicket: " + newDuplicateITTicket);
var gaSP = new GlideAjax('GlobalAgentWorkspace');
gaSP.addParam('sysparm_name','setSolutionProposed');
gaSP.addParam('sysparm_taskId', taskId);
gaSP.addParam('sysparm_table', table);
gaSP.addParam('sysparm_comments', newProposedSolution);
gaSP.addParam('sysparm_close_notes', newCloseNotes);
gaSP.addParam('sysparm_close_code', newCloseCode);
gaSP.addParam('sysparm_ticketType', newTicketType);
gaSP.addParam('sysparm_duplicate', newDuplicateITTicket);
gaSP.getXMLAnswer(function(response) {
g_form.save();
});
});
}
All of this appears to update the ticket as expected.
What am I missing from the reference type field to get it working?
Is there any g_modal documentation other than looking through OOB scripts?
- 5,823 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2022 02:11 AM
Hi
I have the same problem. I don't know if you were able to resolve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2022 12:47 PM
same issue