Skip to content

Commit

Permalink
Deploy Resilient/resilient-community-apps to github.ibm.com/Resilient…
Browse files Browse the repository at this point in the history
…/resilient-community-apps.git:gh-pages
  • Loading branch information
JOHNQUIR committed Mar 14, 2024
1 parent 023f706 commit d717965
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 15 deletions.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/fn_service_now/README.doctree
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions _sources/fn_service_now/README.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ docs/customize_resilient_guide/README
Specify all changes in this release. Do not remove the release
notes of a previous release
-->
### v2.2.1
* Bug fix for breaking html formatted fields on a SOAR incident.

### v2.2.0
* Added playbooks
* Validated on ServiceNow Vancouver release (use v2.1.0 on ServiceNow)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,11 @@ init_snow_note_text = f"""Record created from a IBM SOAR Incident ID: {incident.
Incident Type(s): {', '.join(incident.incident_type_ids)}"""

# If the user adds a comment when they invoke the rule, that comment gets concatenated here
if playbook.inputs.sn_initial_note.content
init_snow_note_text = "{init_snow_note_text}\n\n{playbook.inputs.sn_initial_note.content}")
initial_note = None
if getattr(playbook.inputs, "sn_initial_note", None):
initial_note = getattr(playbook.inputs, "sn_initial_note", None).content
if initial_note:
init_snow_note_text = f"{init_snow_note_text}\n\n{initial_note}"

# ID of this incident
inputs.incident_id = incident.id
Expand All @@ -186,7 +189,7 @@ inputs.incident_id = incident.id
inputs.sn_init_work_note = init_snow_note_text

# Any further information you want to send to ServiceNow. Each Key/Value pair is attached to the Request object and accessible in ServiceNow.
# ServiceNow Example:: setValue('assignment_group', request.body.data.sn_optional_fields.assignment_group)
# ServiceNow Example: setValue('assignment_group', request.body.data.sn_optional_fields.assignment_group)
# For SIR tables it is recommended to map "business_criticality" to sn_severity_map as that is visible in the SNOW query_builder
# (see the example commented out below)
inputs.sn_optional_fields = dumps({
Expand Down Expand Up @@ -436,15 +439,17 @@ inputs.incident_id = incident.id

# The state to change the record to
# inputs.sn_record_state = map_sn_record_states["Closed"]
inputs.sn_record_state = map_sn_record_states[playbook.inputs.sn_record_state]
inputs.sn_record_state = map_sn_record_states[getattr(playbook.inputs, "sn_record_state", None)]

# The resolution notes that are normally required when you close a ServiceNow record
# inputs.sn_close_notes = "This incident has been resolved in IBM SOAR. No further action required"
inputs.sn_close_notes = playbook.inputs.sn_close_notes
if getattr(playbook.inputs, "sn_close_notes", None):
inputs.sn_close_notes = getattr(playbook.inputs, "sn_close_notes", None)

# The ServiceNow 'close_code' that you normally select when closing a ServiceNow record
# inputs.sn_close_code = "Solved (Permanently)"
inputs.sn_close_code = playbook.inputs.sn_close_code
if getattr(playbook.inputs, "sn_close_code", None):
inputs.sn_close_code = getattr(playbook.inputs, "sn_close_code", None)

# Add a Work Note to the Record in ServiceNow
inputs.sn_close_work_note = f"This record's state has been changed to {playbook.inputs.sn_record_state} by IBM SOAR"
Expand Down Expand Up @@ -719,7 +724,7 @@ inputs.sn_query_field = "name"

# The value to equate the cell to
# Get the group name from the Rule Activity Field with:
inputs.sn_query_value = playbook.inputs.sn_assignment_group
inputs.sn_query_value = getattr(playbook.inputs, "sn_assignment_group", None)

## OR Set group name statically with:
## inputs.sn_query_value = "IT Securities"
Expand Down
7 changes: 7 additions & 0 deletions fn_service_now/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,12 @@ <h2>Release Notes<a class="headerlink" href="#release-notes" title="Link to this
Specify all changes in this release. Do not remove the release
notes of a previous release
-->
<section id="v2-2-1">
<h3>v2.2.1<a class="headerlink" href="#v2-2-1" title="Link to this heading">#</a></h3>
<ul class="simple">
<li><p>Bug fix for breaking html formatted fields on a SOAR incident.</p></li>
</ul>
</section>
<section id="v2-2-0">
<h3>v2.2.0<a class="headerlink" href="#v2-2-0" title="Link to this heading">#</a></h3>
<ul class="simple">
Expand Down Expand Up @@ -565,6 +571,7 @@ <h2>Documentation<a class="headerlink" href="#documentation" title="Link to this
<ul>
<li><a class="reference internal" href="#">ServiceNow</a><ul>
<li><a class="reference internal" href="#release-notes">Release Notes</a><ul>
<li><a class="reference internal" href="#v2-2-1">v2.2.1</a></li>
<li><a class="reference internal" href="#v2-2-0">v2.2.0</a></li>
<li><a class="reference internal" href="#changes">2.2.0 Changes</a></li>
<li><a class="reference internal" href="#v2-1-0">v2.1.0</a></li>
Expand Down
19 changes: 12 additions & 7 deletions fn_service_now/docs/customize_resilient_guide/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,11 @@ <h3>Function - SNOW: Create Record<a class="headerlink" href="#function-snow-cre
<span class="s2"> Incident Type(s): </span><span class="si">{</span><span class="s1">&#39;, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">incident</span><span class="o">.</span><span class="n">incident_type_ids</span><span class="p">)</span><span class="si">}</span><span class="s2">&quot;&quot;&quot;</span>

<span class="c1"># If the user adds a comment when they invoke the rule, that comment gets concatenated here</span>
<span class="k">if</span> <span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="o">.</span><span class="n">sn_initial_note</span><span class="o">.</span><span class="n">content</span>
<span class="n">init_snow_note_text</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="si">{init_snow_note_text}</span><span class="se">\n\n</span><span class="si">{playbook.inputs.sn_initial_note.content}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">initial_note</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="p">,</span> <span class="s2">&quot;sn_initial_note&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span>
<span class="n">initial_note</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="p">,</span> <span class="s2">&quot;sn_initial_note&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span><span class="o">.</span><span class="n">content</span>
<span class="k">if</span> <span class="n">initial_note</span><span class="p">:</span>
<span class="n">init_snow_note_text</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">init_snow_note_text</span><span class="si">}</span><span class="se">\n\n</span><span class="si">{</span><span class="n">initial_note</span><span class="si">}</span><span class="s2">&quot;</span>

<span class="c1"># ID of this incident</span>
<span class="n">inputs</span><span class="o">.</span><span class="n">incident_id</span> <span class="o">=</span> <span class="n">incident</span><span class="o">.</span><span class="n">id</span>
Expand All @@ -577,7 +580,7 @@ <h3>Function - SNOW: Create Record<a class="headerlink" href="#function-snow-cre
<span class="n">inputs</span><span class="o">.</span><span class="n">sn_init_work_note</span> <span class="o">=</span> <span class="n">init_snow_note_text</span>

<span class="c1"># Any further information you want to send to ServiceNow. Each Key/Value pair is attached to the Request object and accessible in ServiceNow.</span>
<span class="c1"># ServiceNow Example:: setValue(&#39;assignment_group&#39;, request.body.data.sn_optional_fields.assignment_group)</span>
<span class="c1"># ServiceNow Example: setValue(&#39;assignment_group&#39;, request.body.data.sn_optional_fields.assignment_group)</span>
<span class="c1"># For SIR tables it is recommended to map &quot;business_criticality&quot; to sn_severity_map as that is visible in the SNOW query_builder</span>
<span class="c1"># (see the example commented out below)</span>
<span class="n">inputs</span><span class="o">.</span><span class="n">sn_optional_fields</span> <span class="o">=</span> <span class="n">dumps</span><span class="p">({</span>
Expand Down Expand Up @@ -890,15 +893,17 @@ <h3>Function - SNOW: Close Record<a class="headerlink" href="#function-snow-clos

<span class="c1"># The state to change the record to</span>
<span class="c1"># inputs.sn_record_state = map_sn_record_states[&quot;Closed&quot;]</span>
<span class="n">inputs</span><span class="o">.</span><span class="n">sn_record_state</span> <span class="o">=</span> <span class="n">map_sn_record_states</span><span class="p">[</span><span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="o">.</span><span class="n">sn_record_state</span><span class="p">]</span>
<span class="n">inputs</span><span class="o">.</span><span class="n">sn_record_state</span> <span class="o">=</span> <span class="n">map_sn_record_states</span><span class="p">[</span><span class="nb">getattr</span><span class="p">(</span><span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="p">,</span> <span class="s2">&quot;sn_record_state&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)]</span>

<span class="c1"># The resolution notes that are normally required when you close a ServiceNow record</span>
<span class="c1"># inputs.sn_close_notes = &quot;This incident has been resolved in IBM SOAR. No further action required&quot;</span>
<span class="n">inputs</span><span class="o">.</span><span class="n">sn_close_notes</span> <span class="o">=</span> <span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="o">.</span><span class="n">sn_close_notes</span>
<span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="p">,</span> <span class="s2">&quot;sn_close_notes&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span>
<span class="n">inputs</span><span class="o">.</span><span class="n">sn_close_notes</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="p">,</span> <span class="s2">&quot;sn_close_notes&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>

<span class="c1"># The ServiceNow &#39;close_code&#39; that you normally select when closing a ServiceNow record</span>
<span class="c1"># inputs.sn_close_code = &quot;Solved (Permanently)&quot;</span>
<span class="n">inputs</span><span class="o">.</span><span class="n">sn_close_code</span> <span class="o">=</span> <span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="o">.</span><span class="n">sn_close_code</span>
<span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="p">,</span> <span class="s2">&quot;sn_close_code&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span>
<span class="n">inputs</span><span class="o">.</span><span class="n">sn_close_code</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="p">,</span> <span class="s2">&quot;sn_close_code&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>

<span class="c1"># Add a Work Note to the Record in ServiceNow</span>
<span class="n">inputs</span><span class="o">.</span><span class="n">sn_close_work_note</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;This record&#39;s state has been changed to </span><span class="si">{</span><span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="o">.</span><span class="n">sn_record_state</span><span class="si">}</span><span class="s2"> by IBM SOAR&quot;</span>
Expand Down Expand Up @@ -1226,7 +1231,7 @@ <h3>Function - SNOW: Lookup sys_id<a class="headerlink" href="#function-snow-loo

<span class="c1"># The value to equate the cell to</span>
<span class="c1"># Get the group name from the Rule Activity Field with:</span>
<span class="n">inputs</span><span class="o">.</span><span class="n">sn_query_value</span> <span class="o">=</span> <span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="o">.</span><span class="n">sn_assignment_group</span>
<span class="n">inputs</span><span class="o">.</span><span class="n">sn_query_value</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">playbook</span><span class="o">.</span><span class="n">inputs</span><span class="p">,</span> <span class="s2">&quot;sn_assignment_group&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>

<span class="c1">## OR Set group name statically with:</span>
<span class="c1">## inputs.sn_query_value = &quot;IT Securities&quot;</span>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit d717965

Please sign in to comment.