Posts

JIRA Data Extract into Google Sheets through an API

function callJIRAPI() { // first, clear the sheet contents           var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet() var range = sheet.getRange("A1:G100"); range.clearContent(); // create the auth token for the API request to JIRA var pair = "firstname.lastname@mydomain.com:<My API Key from JIRA>" var base64 = Utilities.base64Encode(pair) var authHeader = "Basic " + base64 var url = "https://mydomain.atlassian.net/rest/api/3/search?jql=<JQL Query here>" // execute the query and parse the result as JSON var response = UrlFetchApp.fetch(url, { headers: { Authorization: authHeader, ContentType: 'application/json' } }); var dataSet = JSON.parse(response.getContentText()); // Create an array to store the results and push the column headers. These should match to the columns extracted below var rows = [] rows.push(["JiraID","CreatedBy","AssignedTo","Du...

Extract user details into Excel from JIRA API in Powershell

Function Get-JIRAExtract { Param( [Parameter( Mandatory=$true, HelpMessage="JIRA id of the user")] [string]$assigneeId, [Parameter( Mandatory=$true, HelpMessage="Name of user.")] [string]$assigneeName, [Parameter( Mandatory=$false, HelpMessage="Target Folder.")] [string]$targetFolder = "c:\temp2" ) try { $token = "xxx" $pair = "fname.lname@company.com:$token" $bytes = [System.Text.Encoding]::ASCII.GetBytes($pair) $base64 = [System.Convert]::ToBase64String($bytes) $basicAuthValue = "Basic $base64" $headers = @{ Authorization = $basicAuthValue } $url = "https://mycompany.atlassian.net/rest/api/3/search?maxResults=1000&jql=assignee%20in%20($assigneeId)AND created >= -24w AND status in ('Complete', 'In Progress', 'Resolved', 'Closed')" Write-Host "Call url $url" $json = Invoke-RestMethod -Uri $url -Method Get -Headers $headers...

How can I call a JIRA api through Powershell?

 Navigate to https://id.atlassian.com/manage-profile/security/api-tokens and create an API token Then use the following code: $pair = "me@example.com:<My token here>" $bytes = [System.Text.Encoding]::ASCII.GetBytes($pair) $base64 = [System.Convert]::ToBase64String($bytes) $basicAuthValue = "Basic $base64" $headers = @{ Authorization = $basicAuthValue } $json = Invoke-RestMethod -Uri "https://<mydomain>.atlassian.net/rest/api/3/search?jql= <jql here>" -Method Get -Headers $headers

How can I call OWASP ZAP from the command line?

 Adding Dynamic Application Security testing to your CI/CD pipeline can help you identify potential security threats earlier in the development cycle (did someone say 'Shift Left'?). There are many tools available to assist (SonarQube is very popular) but ZAP  (from our friends at OWASP) gives insight into common vulnerabilities. To execute it from a COMMAND line 1. install JAVA 2. download the solution from  here 3. navigate to your install folder on your drive (I used to the default "C:\Program Files\OWASP\Zed Proxy Attack"). 4. Release the hounds java -jar {YOUR ZAP VERSION} -cmd -quickurl {YOUR API TO QUERY} -quickprogress -quickout {FILE LOCATION TO STORE THE RESULTS} -nostdout My example is as follows: java -jar zap-2.11.0.jar -cmd -quickurl http://localhost/api/values -quickprogress -quickout "c:\temp\out.json" -nostdout

How do I add a custom background in Microsoft Teams?

 Teams has become one of the de-facto platforms for modern workplace communication. To personalize your virtual meeting space, copy your favourite image to %APPDATA%\Microsoft\Teams\Backgrounds\Uploads and relaunch Teams. Your images are now available for selection as backgrounds.

A quick way to create dummy text using MSWord

 While creating a sample page, I needed to populate some sample text quickly without using any documents from the office. I started random typing, but I quickly remembered the built in marcos in Word for just such a purpose. If you type in =lorem() and press enter, you get one line of Lorem Ipsum if you type in  =lorem(10) and press enter, you get 10 lines. If you prefer English to Latin, then type in  =rand(10) and press enter for 10 lines of 'random' text (not really random, but its text that is readable that I did not have to type) 

Confluence: How to create a 'DRAFT' watermark using CSS

Image
I added the following to my Confluence page: To do it, I put the following text in an HTML block at the top of the page: <style> .watermark {     opacity: 0.5;     color: BLACK;     position: fixed;     top: 45%;     left: 50%; font-size: 110px; font-weight: 100;     background: yellow; padding-left: 50px; padding-right: 50px; } .rotate {   transform: rotate(-45deg);   /* Legacy vendor prefixes that you probably don't need... */   /* Safari */   -webkit-transform: rotate(-45deg);   /* Firefox */   -moz-transform: rotate(-45deg);   /* IE */   -ms-transform: rotate(-45deg);   /* Opera */   -o-transform: rotate(-45deg);   /* Internet Explorer */   filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); } </style> <div class="watermark rotate ">Draft</div> It seems to work well across browser too.