Skip to content

Instantly share code, notes, and snippets.

@justaguywhocodes
Created April 16, 2025 12:41
Show Gist options
  • Save justaguywhocodes/a763139891b1cbb96c2a810aa3029c69 to your computer and use it in GitHub Desktop.
Save justaguywhocodes/a763139891b1cbb96c2a810aa3029c69 to your computer and use it in GitHub Desktop.
$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 `
-Headers $headers `
-ContentType "application/json" `
-Body "{`n `"fields`": {`n `"assignee`": {`n `"id`": `"5b109f2e9729b51b54dc274d`"`n },`n `"components`": [`n {`n `"id`": `"10000`"`n }`n ],`n `"customfield_10000`": `"09/Jun/19`",`n `"customfield_20000`": `"06/Jul/19 3:25 PM`",`n `"customfield_30000`": [`n `"10000`",`n `"10002`"`n ],`n `"customfield_40000`": {`n `"content`": [`n {`n `"content`": [`n {`n `"text`": `"Occurs on all orders`",`n `"type`": `"text`"`n }`n ],`n `"type`": `"paragraph`"`n }`n ],`n `"type`": `"doc`",`n `"version`": 1`n },`n `"customfield_50000`": {`n `"content`": [`n {`n `"content`": [`n {`n `"text`": `"Could impact day-to-day work.`",`n `"type`": `"text`"`n }`n ],`n `"type`": `"paragraph`"`n }`n ],`n `"type`": `"doc`",`n `"version`": 1`n },`n `"customfield_60000`": `"jira-software-users`",`n `"customfield_70000`": [`n `"jira-administrators`",`n `"jira-software-users`"`n ],`n `"customfield_80000`": {`n `"value`": `"red`"`n },`n `"description`": {`n `"content`": [`n {`n `"content`": [`n {`n `"text`": `"Order entry fails when selecting supplier.`",`n `"type`": `"text`"`n }`n ],`n `"type`": `"paragraph`"`n }`n ],`n `"type`": `"doc`",`n `"version`": 1`n },`n `"duedate`": `"2019-05-11`",`n `"environment`": {`n `"content`": [`n {`n `"content`": [`n {`n `"text`": `"UAT`",`n `"type`": `"text`"`n }`n ],`n `"type`": `"paragraph`"`n }`n ],`n `"type`": `"doc`",`n `"version`": 1`n },`n `"fixVersions`": [`n {`n `"id`": `"10001`"`n }`n ],`n `"issuetype`": {`n `"id`": `"10000`"`n },`n `"labels`": [`n `"bugfix`",`n `"blitz_test`"`n ],`n `"parent`": {`n `"key`": `"PROJ-123`"`n },`n `"priority`": {`n `"id`": `"20000`"`n },`n `"project`": {`n `"id`": `"10000`"`n },`n `"reporter`": {`n `"id`": `"5b10a2844c20165700ede21g`"`n },`n `"security`": {`n `"id`": `"10000`"`n },`n `"summary`": `"Main order flow broken`",`n `"timetracking`": {`n `"originalEstimate`": `"10`",`n `"remainingEstimate`": `"5`"`n },`n `"versions`": [`n {`n `"id`": `"10000`"`n }`n ]`n },`n `"update`": {}`n}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment