Skip to content

Instantly share code, notes, and snippets.

View derekxmartin's full-sized avatar

Derek Martin derekxmartin

View GitHub Profile
$uri = 'https://YOUR-VECTR-HOST/sra-purpletools-rest/graphql'
$headers = @{
Authorization = 'VEC1 YOUR_API_KEY_ID:YOUR_API_KEY_SECRET'
}
$query = @'
query ListOutcomes {
outcomes {
id
e7cd9332bebe1d9f7a142a25a68d0e22
#requires -Version 5.1
Set-StrictMode -Version 2.0
$ErrorActionPreference = 'Stop'
function Get-Value {
param($Object, [string] $Name, $Default = $null)
if ($null -eq $Object) { return $Default }
if ($Object -is [Collections.IDictionary]) {
if ($Object.Contains($Name) -and $null -ne $Object[$Name]) { return $Object[$Name] }
return $Default
#requires -Version 5.1
Set-StrictMode -Version 2.0
$ErrorActionPreference = 'Stop'
function Get-Value {
param($Object, [string] $Name, $Default = $null)
if ($null -eq $Object) { return $Default }
if ($Object -is [Collections.IDictionary]) {
if ($Object.Contains($Name) -and $null -ne $Object[$Name]) { return $Object[$Name] }
return $Default
#requires -Version 5.1
Set-StrictMode -Version 2.0
$ErrorActionPreference = 'Stop'
function Get-Value {
param($Object, [string] $Name, $Default = $null)
if ($null -eq $Object) { return $Default }
if ($Object -is [Collections.IDictionary]) {
if ($Object.Contains($Name) -and $null -ne $Object[$Name]) { return $Object[$Name] }
return $Default
#requires -Version 5.1
<#
.SYNOPSIS
Creates Jira Data Center issues for scenarios in completed Cymulate assessments, then applies configured enrichment.
.EXAMPLE
.\Sync-CymulateToJira.ps1 -ConfigPath .\config.jira.json -RunDate '2026-09-17' -DryRun -Verbose
.EXAMPLE
.\Sync-CymulateToJira.ps1 -StartDate '2026-09-01' -EndDate '2026-09-17' -WhatIf
.EXAMPLE
.\Sync-CymulateToJira.ps1 -StartDate '2026-09-20' -EndDate '2026-09-27' -DryRun -DiagnosticLogPath .\jira-diagnostic.log -Verbose
#requires -Version 5.1
Set-StrictMode -Version 2.0
$ErrorActionPreference = 'Stop'
function Get-Value {
param($Object, [string] $Name, $Default = $null)
if ($null -eq $Object) { return $Default }
if ($Object -is [Collections.IDictionary]) {
if ($Object.Contains($Name) -and $null -ne $Object[$Name]) { return $Object[$Name] }
return $Default
$config = Get-Content .\config.jira.json -Raw | ConvertFrom-Json
$jiraBase = $config.Jira.BaseUrl.TrimEnd('/')
$pat = [Net.NetworkCredential]::new(
'',
(Read-Host 'Paste the raw Jira PAT' -AsSecureString)
).Password.Trim()
if ([string]::IsNullOrWhiteSpace($pat)) {
throw 'No token entered.'
#!/usr/bin/env python3
"""Build a Jira v2 create-issue JSON body from createmeta.
Reads classic createmeta or /issue/createmeta/{project}/issuetypes/{id}.
Prints a usable POST /rest/api/2/issue payload to STDOUT.
Prints field id, required flag, and datatype to STDERR.
Usage:
python3 createmeta_to_payload.py createmeta.json
python3 createmeta_to_payload.py < createmeta.json
#!/usr/bin/env python3
"""Create a Jira issue with v2 API, then update it with extra custom fields.
HTTP transport matches the ssl + urllib3.PoolManager approach used internally.
"""
from __future__ import annotations
import json
import ssl