Skip to content

Instantly share code, notes, and snippets.

View justaguywhocodes's full-sized avatar

Toussaint Louverture justaguywhocodes

View GitHub Profile
**Jira Ticket: Requirements for VECTR Test Cases API to Jira Ticket Script**
**Description:**
Develop a script to create Jira tickets from VECTR test cases API data.
**Requirements:**
1. **Authentication**
- Create VECTR API credentials (e.g., API key or token) to authenticate requests securely.
- Store VECTR credentials in environment variables or a secrets manager to prevent exposure.
**Jira Ticket: Requirements for VECTR Test Cases API to Jira Ticket Script**
**Description:**
Develop a script to create Jira tickets from VECTR test cases API data.
**Requirements:**
1. **Authentication**
- VECTR: API key/token, secure storage (env variables).
- Jira: API token, user with issue creation permissions, secure storage.
import requests
from requests.auth import HTTPBasicAuth
import json
# Jira instance URL and credentials
JIRA_URL = "https://your-jira-instance.atlassian.net"
EMAIL = "[email protected]"
API_TOKEN = "your-api-token"
# Issue key
1. That’s not how you hold a rifle.
2. That’s not how you wear a vest.
3. Why is the officer on the right holding his rifle like he’s announcing a caliphate?
Sub Auto_Open()
Set objShell = CreateObject("Wscript.Shell")
objShell.Exec ("notepad.exe")
End Sub
IgBTAGUAdAAtAEMAbwBuAHQAZQBuAHQAIAAtAHAAYQB0AGgAIAAiACQAZQBuAHYAOgBTAHkAcwB0AGUAbQBSAG8AbwB0AC8AVABlAG0AcAAvAGEAcgB0AC0AbQBhAHIAawBlAHIALgB0AHgAdAAiACAALQB2AGEAbAB1AGUAIAAiAEgAZQBsAGwAbwAgAGYAcgBvAG0AIAB0AGgAZQAgAEIATgBQAFAAIABSAGUAZAAgAFQAZQBhAG0AIgAiAA==
<?XML version="1.0"?>
<scriptlet>
<registration
description="Tester"
progid="Tester"
version="1.00"
classid="{AAAA0000-0000-0000-0000-0000AAAAAAAA}"
>
<script language="JScript">
<?xml version="1.0"?>
<command>
<a>
<execute>write-host -ForegroundColor Cyan "$(Get-Date -Format s) Download Cradle test success!`n"</execute>
</a>
</command>
$username = "[email protected]"
$password = ConvertTo-SecureString "<api_token>" -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($username, $password)
$headers = @{
"Accept" = "application/json"
}
$response = Invoke-WebRequest -Uri "https://your-domain.atlassian.net/rest/api/3/issue" `
-Method Post `
-Credential $credential `
-Authentication Basic `
curl --request POST \
--url 'https://your-domain.atlassian.net/rest/api/3/issue' \
--user '[email protected]:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"fields": {
"assignee": {
"id": "5b109f2e9729b51b54dc274d"
},