JIRA is a well-known tool in the market and is used for bug tracking, issue tracking, and project management. LEAPWORK offers integration with Jira by automatically creating bugs in JIRA when automation flows in LEAPWORK fails.
LEAPWORK Automation Platform comes with REST API, allowing any third party system to run automation flows on the platform and to retrieve the results. Similarly, we have Jira's REST API for creating bugs.
As part of the integration, we have a Windows Powershell script that runs a pre-defined LEAPWORK run list, polls for the results until they are available, and then loops through all failed cases and creates bugs in JIRA as appropriate using API's.
The following changes are required:-
1. Generate an AccessKey from LEAPWORK Studio->Settings->Add Key.
2. Replace the generated key with Accesskey value
$headers.Add("AccessKey","bTyGAd0UGL70JFQg")
3. Get your schedule name from LEAPWORK Studio->Runlist->Expand Runlist and replace it in Line 66 with schedule name
#Run the LEAPWORK schedule "SmokeRunSchedule" and get the results.
$runResult = RunScheduleAndGetResults("SmokeRunSchedule")
4. Create an API token for Jira and then replace with username: password with your Jira username: APITokenKeyOfJira as highlighted below
https://confluence.atlassian.com/cloud/api-tokens-938839638.html
5.Create a project in Jira where you want bugs to be created replace it with key-value
# Create json issue.
$body = '{ "fields": { "project": { "key": "AX" }, "summary": "' + $bugTitle + '", "description": "' + $bugDescription + '", "issuetype": { "name": "Bug" } } }
6. Enter the Jira instance URL.
# Create bug.
Invoke-RestMethod -Headers $header -Method Post -Body $body "https://YOURINSTANCE.atlassian.net/rest/api/2/issue/"
After running the PowerShell script, the schedule will be executed and for failed flows, a bug will be logged in Jira.
For any clarification, please contact our Priority Support.
Comments
0 comments
Please sign in to leave a comment.