# \[ServiceNow integration\]How to change the "State" field of ServiceNow incident dashboard

**URL:** <https://community.dynatrace.com/t/servicenow-integration-how-to-change-the-state-field-of-servicenow-incident-dashboard/22730>\
**Category:** Automations\
**Tags:** servicenow\
**Created:** [December 13, 2019, 1:41am UTC](https://community.dynatrace.com/t/servicenow-integration-how-to-change-the-state-field-of-servicenow-incident-dashboard/22730 "2019-12-13T01:41:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ntanaka](https://avatars.discourse-cdn.com/v4/letter/n/74df32/32.png) [@ntanaka](https://community.dynatrace.com/u/ntanaka)\
**Post date:** [December 13, 2019, 1:41am UTC](https://community.dynatrace.com/t/servicenow-integration-how-to-change-the-state-field-of-servicenow-incident-dashboard/22730/1 "2019-12-13T01:41:53Z")

</div>

Hi,

This question is about ServiceNow problem notification.  
Do you have any feature to change the “State” field of ServiceNow incident dashboard?

There are 2 Dynatrace notifications, problem open and resolved, but resolved message do not change incident state closed so we have to close incident manually.

Best Regards,  
Natsumi Tanaka

---

<div class="post-metadata">

**Author:** ![wolfgang\_beer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/wolfgang_beer/32/14717_2.png) [@wolfgang\_beer](https://community.dynatrace.com/u/wolfgang_beer)\
**Post date:** [December 13, 2019, 9:27am UTC](https://community.dynatrace.com/t/servicenow-integration-how-to-change-the-state-field-of-servicenow-incident-dashboard/22730/2 "2019-12-13T09:27:26Z")

</div>

Hi Natsumi,

By ITIL definition an automated incident creation should now close an incident. Therefore, we do not automatically close the ServiceNow incident. But there is a very simple modification to achieve that by simply change the problem to incident transformation map in ServiceNow, to set the ‘Close’ state instead of the resolved one.

Best greetings,

Wolfgang

---

<div class="post-metadata">

**Author:** ![ntanaka](https://avatars.discourse-cdn.com/v4/letter/n/74df32/32.png) [@ntanaka](https://community.dynatrace.com/u/ntanaka)\
**Post date:** [December 16, 2019, 1:04am UTC](https://community.dynatrace.com/t/servicenow-integration-how-to-change-the-state-field-of-servicenow-incident-dashboard/22730/3 "2019-12-16T01:04:18Z")

</div>

Hi Wolfgang,

Thank you for your answer.  
I think the following screenshot seems to be ServiceNow Table Transform Map you mentioned.

 ![22917-1576457338124.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/3/83fa6ce54ecee23b21e5782bd321e6d691689da6.png)  
If it is true, then I confirmed the state field is defined by a script.

 ![22918-1576457777976.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/3/83a59aa2bf9a8115bf1d4fd87b46d72b2c59293b.png)

In order to add automation close feature, do we need to add condition "if (source.problem\_state == “RESOLVED”)?

---

<div class="post-metadata">

**Author:** ![wolfgang\_beer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/wolfgang_beer/32/14717_2.png) [@wolfgang\_beer](https://community.dynatrace.com/u/wolfgang_beer)\
**Post date:** [December 17, 2019, 7:07am UTC](https://community.dynatrace.com/t/servicenow-integration-how-to-change-the-state-field-of-servicenow-incident-dashboard/22730/4 "2019-12-17T07:07:39Z")

</div>

Yes that’s exactly the place to change the state.

---

<div class="post-metadata">

**Author:** ![ntanaka](https://avatars.discourse-cdn.com/v4/letter/n/74df32/32.png) [@ntanaka](https://community.dynatrace.com/u/ntanaka)\
**Post date:** [December 17, 2019, 8:14am UTC](https://community.dynatrace.com/t/servicenow-integration-how-to-change-the-state-field-of-servicenow-incident-dashboard/22730/5 "2019-12-17T08:14:50Z")

</div>

Thank you for your answer.

I have a question about this script behavior.

According to the script, If source.problem\_state is “OPEN”, then it returns 1 as the incident state.  
If source.problem\_state is not “OPEN” and ‘x\_dynat\_ruxit.autoresolveproblems’ is ‘true’, then it returns 6 as the incident state.

I confirmed the “source.problem\_state”, and found there are 2 problem records for the same Dynatrace problem in the table “x\_dynat\_ruxit\_problems” like this.  
I wonder how the script works when there are multiple records for one problem.

 ![22941-problem.png](https://global.discourse-cdn.com/dynatrace/original/2X/3/3cec4abde9eada2c539da99652efb7e8d4b208a0.png)

Best Regards,  
Natsumi Tanaka

---

<div class="post-metadata">

**Author:** ![dt\_mrundel](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@dt\_mrundel](https://community.dynatrace.com/u/dt_mrundel)\
**Post date:** [June 6, 2023, 4:38pm UTC](https://community.dynatrace.com/t/servicenow-integration-how-to-change-the-state-field-of-servicenow-incident-dashboard/22730/6 "2023-06-06T16:38:38Z")

</div>

Also wondering the same. Currently in our implementation, if a Dynatrace problem gets created and then resolved, it will mark the incident in Service Now as resolved, but if/when the same problem comes back up and resolves again the incident stays open and doesn’t go into a closed/resolved state.
