In servicenow, I am getting some weird value in GlideDateTime query. When I am viewing…
- User
In servicenow, I am getting some weird value in GlideDateTime query. When I am viewing the list view, the duration filed is showing correct value. But while we are pulling the data of that specific field in the reports, we can see a weird result.
Script:
After Insert, update Business rule
(function executeRule(current, previous /null when async/ ) {
var inc = new GlideRecord('sysapproval_approver'); inc.addQuery('sys_id', current.sys_id); inc.query(); if (inc.next()) { var start = new GlideDateTime(inc.sys_created_on); var end = new GlideDateTime(inc.u_approved_on); var dur = GlideDateTime.subtract(start, end); //the difference between gdt1 and gdt2 gs.info(dur.getDisplayValue()); inc.u_duration = dur; inc.update(); } } )(current, previous);
While seeing in the list view, I can see correct value. But when I am trying to pull the data in the report, I am seeing some weired result.
Screenshot is attached.
Duration type field: Duration
Report type: Multipivot
Someone please help to identify the issue.
- Assistant
- User
I created a Custom Widget and added in Standard Ticket configurations of Action widget. Now its showing both buttons this- We need to show buttons based on state. If i click on Cancel-Then the state of the RITM goes to Closed Incomplete and If i click on Reopen then it moves to open state.
But we want to hide the buttons- If State is Open then only need to show Cancel button
if State is Closed-Incomplete then only need to show the Reopen Button.
If the state is not one of Open or Closed incomplete we don't need to show the actions. servicenow
- Assistant