Need clear 'closed' and 'closed by' by fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 07:25 AM
Hello Guys,
While reopening incident from java application 'incident state' is updated to 'In Progress' but 'closed' and 'closed by' fields not getting clear.
My JSON Object is below.
{
"active": "true",
"state" :"2",
"incident_state": "9",
"closed_by":" ",
"u_approval":" ",
"closed_at" :" "
}
API : https://******dev.service-now.com/api/now/table/incident/8346940f0f52320039e8348ce1050e13
Method Type : PUT
Please let me know, If am doing any thing wrong.
Thanks,
Rishikesh Kashid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 07:51 AM
A on change client script should work
On change field name "state"
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
if ( newValue == '''In Progress" ) {
g_form.setValue('closed','');
g_form.setValue('closed_by','');
return;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2017 03:09 AM
Hello Brendan Wilson,
I wont need script. Am using API for reopening incident.
I have integrated service-now in my java application.I want same behavior at both side.
May be i do not have access to clear fields 'closed' and 'closed by'.
Thanks,
Rishikesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 08:22 AM
What you should do is create a new "onBefore" Business Rule that would clear the fields. This way the logic remains in ServiceNow and a Business Rule will run whether the update was done manually by a user logged into ServiceNow or through an integration (like yours).
Here is what your Business Rule would look like:
You may have to change the conditions a bit based on your use cases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 08:23 AM
Hi Rishikesh,
This is something that needs to be performed on the target table as a result of reopen and not using the web services. You should write a before business rule on incident table when state changes to In progress and set the 2 fields to empty (clear them off).
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response