Ticket details to query into table from UI Page

basantsoni
Kilo Guru

Hello Friends,

Please help me here, from emails hyperlinks we are opening a UI Page and updating table records.

How do get ticket information to query into table and update tickets in UI Page.

 

Thanks,

Basant

1 ACCEPTED SOLUTION

Hi Basant,

So url is coming proper.

can you try this to get the value of url parameter sysparm_sysId

var recordSysId = gs.action.getGlideURI().getMap().get('sysparm_sysId')

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

16 REPLIES 16

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Basantsoni,

I remember posting a reply to similar question yesterday from you.

What error you are getting? where you are stuck?

Regards

Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

Thanks for your reply. For testing purpose we make this URL: var attachTaskLink = '<a href="https://avanadedev.service-now.com/ui_page.do?sys_id=8aee0f0c1b7c7f44932343fccd4bcb9f&sysparm_view=&...">' + 'Click here to acknowledge' + '</a>';

Where 1462fd9ddb8de340c20168d35b961974 is sysid of record. Onclick this hyperlink is opening UI Page with message without any issues.

After that, we are using below script in UI Page but still it’s not working

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<h1> ${gs.getMessage('Thank you for acknowledging this referral')}</h1>

<td align="right">
<g:dialog_buttons_ok_cancel ok="return onOK();" cancel="return onCancel();" ok_type="button" cancel_type="button"/>
</td>

<g:evaluate var="jvar_task_table" jelly="true">

var recordSysId = RP.getParameterValue('sysparm_sysId');

var gcis = new GlideRecord('u_gcis_request');
gcis.addQuery('sys_id',recordSysId);
gcis.query();

if(gcis.next()){

gcis.u_acknowledgement_received = 'true';
gcis.u_acknowledgement_date = new GlideDate();
gcis.u_referral_notes = "THis is New Test update from UI Page load.";
gcis.update();

}

</g:evaluate>





</j:jelly>

Thanks,

Basant

Hi Basant,

That is because in the url parameter is sent incorrect; only single & is required and not &&

href="https://avanadedev.service-now.com/ui_page.do?sys_id=8aee0f0c1b7c7f44932343fccd4bcb9f&sysparm_view=&...">' + 'Click here to acknowledge' + '</a>';

what do you get in the log for that in g:evaluate tag

gs.log("recordSysId is: " + recordSysId );

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

basantsoni
Kilo Guru

Hi Ankur, thanks for your reply. 

Now, i can run server side to update our date into service now from HTML only. but how we can get information of ticket like sysid or number, something unique. so that we can use into glide query to query and update.