- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 05:37 AM
Hi I have created a BR on request table, where it checks whether its parent is empty or not.
if not empty then it glide incident table and check for the concerned parent incident and sets it state to request created.
upto this is fine, but I want to set the incident active to false along with its state.
var gr = new GlideRecord('incident');
gr.addQuery('sys_id',current.parent);
gr.query();
if(gr.next()){
gr.state = '9';
gr.active = false;
gr.work_notes='Incident converted to request \n Kindly access Request from Related List';
gr.update();
}
this is changing the state but not setting the active to false.
what to do?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 09:47 AM - edited ‎05-24-2023 09:51 AM
When I tested this and got it to work, I did the condition on the first tab..."when to run" via the GUI, not on the advanced tab. The advanced tab condition is still "current.incident_state != IncidentState.CLOSED && current.incident_state != IncidentState.CANCELED"
^^ I already deleted the custom state in my PDI before I took this screener, but I did this with a custom state of "Request created"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 09:35 AM
You may need to also add your new state to the TaskStateUtil
https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_TaskStateUtil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 09:38 AM
I think I need add the new state here
how to edit this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 09:45 AM
You don't update the SNC version of the script include, you would update this SI:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 09:47 AM - edited ‎05-24-2023 09:52 AM
I have updated incidentstate, but we need ato add the values there as well right in incidentsnc.
one more thing when I updated inc reopen BR condition with resolved state and tried to update the state to resolved and active false. It worked.So when I compared request created and resolved only incidentsnc is the difference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 09:47 AM - edited ‎05-24-2023 09:51 AM
When I tested this and got it to work, I did the condition on the first tab..."when to run" via the GUI, not on the advanced tab. The advanced tab condition is still "current.incident_state != IncidentState.CLOSED && current.incident_state != IncidentState.CANCELED"
^^ I already deleted the custom state in my PDI before I took this screener, but I did this with a custom state of "Request created"