<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to close multiple problem in one go? in Alerting</title>
    <link>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198241#M3225</link>
    <description>&lt;P&gt;I don't want to close all problems. But want to close multiple problems in one go.&lt;/P&gt;&lt;P&gt;Any thought how can I do that?&lt;/P&gt;</description>
    <pubDate>Fri, 11 Nov 2022 18:33:37 GMT</pubDate>
    <dc:creator>roushan_kumar1</dc:creator>
    <dc:date>2022-11-11T18:33:37Z</dc:date>
    <item>
      <title>How to close multiple problem in one go?</title>
      <link>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198149#M3221</link>
      <description>&lt;P&gt;We have 50 app pool running on 20 hosts. So when some IIS reset event happens we see more than 700 individual problem occurs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Out of these 700 problems some get auto closed. And some 100-150 problem I have to close manually.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way where I can close such problem in bulk, like close multiple problem in one go.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 19:06:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198149#M3221</guid>
      <dc:creator>roushan_kumar1</dc:creator>
      <dc:date>2022-11-10T19:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to close multiple problem in one go?</title>
      <link>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198150#M3222</link>
      <description>&lt;P data-unlink="true"&gt;This is a bit of a brute force approach using the /api/v2/problems API, but here's a command line option using curl to close all open problems:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for i in `curl -X GET "https://{your-domain}/e/{your-environment-id}&lt;/SPAN&gt;/api/v2/problems?fields=problemId&amp;amp;pageSize=10&amp;amp;problemSelector=status%28%22open%22%29"&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;-H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token &amp;lt;API-Token&amp;gt;" | json_pp | grep problemId | awk -F\" '{print $4}'`; do curl -X POST "https://{your-domain}/e/{your-environment-id}&lt;/SPAN&gt;/api/v2/problems/$i/close"&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;-H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token &amp;lt;API-Token&amp;gt;" -H "Content-Type: application/json; charset=utf-8" -d "{\"message\":\"string\"}"; done&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This assumes you have json_pp on your system which pretty prints JSON. &amp;nbsp;You can use jq instead if that's available.&amp;nbsp;&lt;SPAN&gt;The above can be modified for specific problems by modifying the problemSelector query parameter. &amp;nbsp;Here are the options available:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Status: status("open") or status("closed"). You can specify only one status.&lt;/LI&gt;&lt;LI&gt;Severity level: severityLevel("level-1","level-2"). Find the possible values in the description of the &lt;STRONG&gt;severityLevel&lt;/STRONG&gt; field of the response.&lt;/LI&gt;&lt;LI&gt;Impact level: impactLevel("level-11","level-2") Find the possible values in the description of the &lt;STRONG&gt;impactLevel&lt;/STRONG&gt; field of the response.&lt;/LI&gt;&lt;LI&gt;Root cause entity: rootCauseEntity("id-1", "id-2").&lt;/LI&gt;&lt;LI&gt;Management zone ID: managementZoneIds("mZId-1", "mzId-2").&lt;/LI&gt;&lt;LI&gt;Management zone name: managementZones("value-1","value-2").&lt;/LI&gt;&lt;LI&gt;Impacted entities: impactedEntities("id-1", "id-2").&lt;/LI&gt;&lt;LI&gt;Affected entities: affectedEntities("id-1", "id-2").&lt;/LI&gt;&lt;LI&gt;Type of affected entities: affectedEntityTypes("value-1","value-2").&lt;/LI&gt;&lt;LI&gt;Problem ID: problemId("id-1", "id-2").&lt;/LI&gt;&lt;LI&gt;Alerting profile ID: problemFilterIds("id-1", "id-2").&lt;/LI&gt;&lt;LI&gt;Alerting profile name (contains, case-insensitive): problemFilterNames("value-1","value-2").&lt;/LI&gt;&lt;LI&gt;Alerting profile name (exact match, case-insensitive): problemFilterNames.equals("value-1","value-2").&lt;/LI&gt;&lt;LI&gt;Entity tags: entityTags("[context]key:value","key:value"). Tags in [context]key:value, key:value, and value formats are detected and parsed automatically. If a value-only tag has a colon (:) in it, you must escape the colon with a backslash(\). Otherwise, the tag will be parsed as a key:value tag. All tag values are case-sensitive.&lt;/LI&gt;&lt;LI&gt;Display ID of the problem: displayId("id-1", "id-2").&lt;/LI&gt;&lt;LI&gt;Under maintenance: underMaintenance(true|false). Shows (true) or hides (false) all problems created during maintenance mode.&lt;/LI&gt;&lt;LI&gt;Text search: text("value"). Text search on the following fields: problem title, event titles, displayId and the id of affected and impacted entities. The text search is case insensitive, partial matching and based on a relevance score. Therefore the relevance sort option should be used to get the most relevant problems first. The special characters ~ and " need to be escaped using a ~ (e.g. double quote search text("~"")). The search value is limited to 30 characters.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 19:29:29 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198150#M3222</guid>
      <dc:creator>mgome</dc:creator>
      <dc:date>2022-11-10T19:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to close multiple problem in one go?</title>
      <link>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198235#M3224</link>
      <description>&lt;P&gt;THanks for replying&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/8132"&gt;@mgome&lt;/a&gt;&amp;nbsp;I will try this solution and let you know.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 17:13:22 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198235#M3224</guid>
      <dc:creator>roushan_kumar1</dc:creator>
      <dc:date>2022-11-11T17:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to close multiple problem in one go?</title>
      <link>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198241#M3225</link>
      <description>&lt;P&gt;I don't want to close all problems. But want to close multiple problems in one go.&lt;/P&gt;&lt;P&gt;Any thought how can I do that?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 18:33:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198241#M3225</guid>
      <dc:creator>roushan_kumar1</dc:creator>
      <dc:date>2022-11-11T18:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to close multiple problem in one go?</title>
      <link>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198243#M3226</link>
      <description>&lt;P&gt;You could use the following in the query string of the first curl command to find problems with IIS in the problem text:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Encoded:&lt;/P&gt;&lt;P&gt;problemSelector%3Dtext(%22IIS%22)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Decoded:&lt;/P&gt;&lt;P&gt;problemSelector=text("IIS")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use this site to encode and decode URL's&lt;/P&gt;&lt;P&gt;&lt;A href="https://meyerweb.com/eric/tools/dencoder/" target="_blank"&gt;https://meyerweb.com/eric/tools/dencoder/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Text search: text("value"). Text search on the following fields: problem title, event titles, displayId and the id of affected and impacted entities. The text search is case insensitive, partial matching and based on a relevance score. Therefore the relevance sort option should be used to get the most relevant problems first. The special characters ~ and " need to be escaped using a ~ (e.g. double quote search text("~"")). The search value is limited to 30 characters.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 19:18:38 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198243#M3226</guid>
      <dc:creator>mgome</dc:creator>
      <dc:date>2022-11-11T19:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to close multiple problem in one go?</title>
      <link>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198252#M3227</link>
      <description>&lt;P&gt;Hi roushan.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you can use python its pretty easy.. you only have to create a api token with read and write rights, replace where it marks on the script and its done&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import requests
import json
 
# body header for api request
tenant = "{replace_tenant}"

headers = {
    'accept': 'application/json; charset=utf-8',
    'Authorization': '{replace_api_token}}',
    'Content-Type': 'application/json; charset=utf-8'
}
# request url wihout parameters

def parseParameters(parametersquery):
    url = "https://" + tenant + ".live.dynatrace.com/api/v2/problems"
    if parametersquery["problemSelector"] == "true":
        criteria = "?problemSelector="
        for key, value in parametersquery["criteria"].items():
            criteria = criteria + key + "("
            for key2, value2 in value.items():
                if value2 == 1:
                    criteria = criteria +'"'+ key2+'"' + ","
            criteria = criteria[:-1] + "),"
        criteria = criteria[:-1]
        #encode critedria html format 
        dict_html_format = {" ": "%20", "(": "%28", ")": "%29", ",": "%2C", '"': "%22"}
        for key, value in dict_html_format.items():
            criteria = criteria.replace(key, value)
        url = url + criteria
    return url

def closeProblem(list_problemId, tenant, headers):
    try :
        for problemId in list_problemId:
            url = "https://" + tenant + ".live.dynatrace.com/api/v2/problems/" + problemId + "/close"
            payload = "{\"message\": \"close problem by api\"}"
            response = requests.post(url , headers=headers , data=payload)
            print(response.text)
            print("problem Closed : " + problemId)
    except Exception as e:
        print(e)
#define parameters query for select problem to close using criteria
parametersquery = {
    "problemSelector": "true",
    "criteria" : { 
        "status": {
            "OPEN": 1,
            "ACKNOWLEDGED": 0,
            "RESOLVED": 0
        },
        "impactLevel": {
            "SERVICE": 0,
            "APPLICATION": 1,
            "INFRASTRUCTURE": 1,
            "ENVIRONMENT": 0
        },
        "managementZones": {
            "{replace_iis_mngmzone_name}": 1
        },
    }
}

# generate url with parameters
url = parseParameters(parametersquery)
# get list of problem to close 
response = requests.get(url, headers=headers)
# convert response to json
json_response = json.loads(response.text)
# get list of  problemId from json_response
list_problemId = []
for problem in json_response["problems"]:
    list_problemId.append(problem["problemId"])
# close problem by list_problemId
if len(list_problemId) &amp;gt; 0:
    closeProblem(list_problemId, tenant, headers)
else:
    print("no problem to close")
 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;its some script that i did sometime ago and adapted to your question.&amp;nbsp; maybe you can set a tag or allready you have this process in a management zone you can use this to close those problems in bulk with a nice comment&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hope it helps&lt;/P&gt;&lt;P&gt;have fun&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2022 07:17:49 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/198252#M3227</guid>
      <dc:creator>rgarzon1</dc:creator>
      <dc:date>2022-11-13T07:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to close multiple problem in one go?</title>
      <link>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/200144#M3268</link>
      <description>&lt;P&gt;Thank you everyone.&lt;/P&gt;&lt;P&gt;I was able to do it through a powershell script.&lt;/P&gt;&lt;P&gt;===========================================================================&lt;/P&gt;&lt;P&gt;$dtToken = "$(DynatraceToken)"&lt;BR /&gt;$inputFile = "$(ProblemInputFile)"&lt;/P&gt;&lt;P&gt;$ProblemID = Get-Content "$inputFile"&lt;/P&gt;&lt;P&gt;$bodyJSON =&lt;BR /&gt;@"&lt;BR /&gt;{&lt;BR /&gt;"message": "auto-close"&lt;BR /&gt;}&lt;BR /&gt;"@&lt;/P&gt;&lt;P&gt;foreach ($Entry in $ProblemID)&lt;BR /&gt;{&lt;BR /&gt;$url = "https://{environmentid}.live.dynatrace.com/api/v2/problems/$Entry/close"&lt;BR /&gt;Invoke-RestMethod -Method Post -URI $url -Body $bodyJSON -ContentType 'application/json' -Headers @{Authorization=("Api-Token {0}" -f $dtToken)}&lt;BR /&gt;write-verbose "Closed - $entry" -verbose&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 18:38:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/200144#M3268</guid>
      <dc:creator>roushan_kumar1</dc:creator>
      <dc:date>2022-12-09T18:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to close multiple problem in one go?</title>
      <link>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/214674#M3562</link>
      <description>&lt;P&gt;How in the&amp;nbsp;&lt;EM&gt;world&amp;nbsp;&lt;/EM&gt;is this not built into the Problems GUI already??&amp;nbsp; This shouldn't even have to be a feature request...&lt;/P&gt;&lt;P&gt;&amp;nbsp; Just put a Close button at the top of the table and then some check boxes beside each problem with the inclusion of a Select-All check box at the top, and boom... Users can then select one, multiple, or all problems and close them in one go.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel like this is a pretty standard feature.&amp;nbsp; It's quite perplexing that this isn't included already...&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 15:55:28 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/214674#M3562</guid>
      <dc:creator>36Krazyfists</dc:creator>
      <dc:date>2023-06-10T15:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to close multiple problem in one go?</title>
      <link>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/231003#M3944</link>
      <description>&lt;P&gt;Yes, agreed.&amp;nbsp; Absolutely poorly done.&amp;nbsp; C'mon guys.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 20:52:08 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Alerting/How-to-close-multiple-problem-in-one-go/m-p/231003#M3944</guid>
      <dc:creator>brianheislerFMC</dc:creator>
      <dc:date>2023-12-05T20:52:08Z</dc:date>
    </item>
  </channel>
</rss>

